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 file is part of gr-satellites
6  *
7  * SPDX-License-Identifier: GPL-3.0-or-later
8  *
9  */
10 
11 #ifndef INCLUDED_VARLEN_PACKET_FRAMER_H
12 #define INCLUDED_VARLEN_PACKET_FRAMER_H
13 
14 #include <gnuradio/block.h>
15 #include <gnuradio/endianness.h>
16 #include <pmt/pmt.h>
17 #include <satellites/api.h>
18 
19 namespace gr {
20 namespace satellites {
21 /*!
22  * \brief insert a packet length field into a tagged stream
23  * \ingroup satellites
24  *
25  * \details
26  * input: stream of bits (unpacked bytes) with packet_len tags
27  * output: a tagged stream of bits containing field length + packet bits
28  *
29  * This block prepends a packet length field into a tagged stream.
30  *
31  */
32 class SATELLITES_API varlen_packet_framer : virtual public gr::block
33 {
34 public:
35  typedef boost::shared_ptr<varlen_packet_framer> sptr;
36 
37  /*!
38  * \param packet_key tag key used to mark packets
39  * \param length_field_size size of the packet length header
40  * \param endianness header inserted msb or lsb
41  * \param use_golay compute 24-bit golay header from 12-bit length
42  * \param sync_word optional pre-header sync pattern
43  */
44  static sptr make(const std::string& packet_key,
45  int length_field_size,
46  endianness_t endianness,
47  bool use_golay,
48  const std::vector<uint8_t> sync_word);
49 };
50 
51 } // namespace satellites
52 } // namespace gr
53 
54 #endif
#define SATELLITES_API
Definition: api.h:31
insert a packet length field into a tagged stream
Definition: varlen_packet_framer.h:33
boost::shared_ptr< varlen_packet_framer > sptr
Definition: varlen_packet_framer.h:35
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: ax100_decode.h:17