GNU Radio's SATELLITES Package
varlen_packet_framer.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2017 Glenn Richardson <glenn@spacequest.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3, or (at your option)
8 * any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>
17 */
18
19#ifndef INCLUDED_VARLEN_PACKET_FRAMER_H
20#define INCLUDED_VARLEN_PACKET_FRAMER_H
21
22#include <satellites/api.h>
23#include <gnuradio/block.h>
24#include <gnuradio/endianness.h>
25#include <pmt/pmt.h>
26
27namespace gr {
28 namespace satellites {
29 /*!
30 * \brief insert a packet length field into a tagged stream
31 * \ingroup satellites
32 *
33 * \details
34 * input: stream of bits (unpacked bytes) with packet_len tags
35 * output: a tagged stream of bits containing field length + packet bits
36 *
37 * This block prepends a packet length field into a tagged stream.
38 *
39 */
40 class SATELLITES_API varlen_packet_framer : virtual public gr::block
41 {
42 public:
43 typedef boost::shared_ptr<varlen_packet_framer> sptr;
44
45 /*!
46 * \param packet_key tag key used to mark packets
47 * \param length_field_size size of the packet length header
48 * \param endianness header inserted msb or lsb
49 * \param use_golay compute 24-bit golay header from 12-bit length
50 * \param sync_word optional pre-header sync pattern
51 */
52 static sptr make(const std::string &packet_key,
53 int length_field_size,
54 endianness_t endianness,
55 bool use_golay,
56 const std::vector<uint8_t> sync_word);
57 };
58
59 } // namespace satellites
60} // namespace gr
61
62#endif
63
#define SATELLITES_API
Definition api.h:30
insert a packet length field into a tagged stream
Definition varlen_packet_framer.h:41
boost::shared_ptr< varlen_packet_framer > sptr
Definition varlen_packet_framer.h:43
static sptr make(const std::string &packet_key, int length_field_size, endianness_t endianness, bool use_golay, const std::vector< uint8_t > sync_word)
Definition ao40_deinterleaver.h:25