GNU Radio Manual and C++ API Reference  3.7.9.2
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
packet_headerparser_b.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /* Copyright 2012 Free Software Foundation, Inc.
3  *
4  * This file is part of GNU Radio
5  *
6  * GNU Radio is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3, or (at your option)
9  * any later version.
10  *
11  * GNU Radio is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with GNU Radio; see the file COPYING. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street,
19  * Boston, MA 02110-1301, USA.
20  */
21 
22 #ifndef INCLUDED_DIGITAL_PACKET_HEADERPARSER_B_H
23 #define INCLUDED_DIGITAL_PACKET_HEADERPARSER_B_H
24 
25 #include <gnuradio/digital/api.h>
26 #include <gnuradio/sync_block.h>
28 
29 namespace gr {
30  namespace digital {
31 
32  /*!
33  * \brief Post header metadata as a PMT
34  * \ingroup packet_operators_blk
35  *
36  * \details
37  * In a sense, this is the inverse block to packet_headergenerator_bb.
38  * The difference is, the parsed header is not output as a stream,
39  * but as a PMT dictionary, which is published to message port with
40  * the id "header_data".
41  *
42  * The dictionary consists of the tags created by the header formatter
43  * object. You should be able to use the exact same formatter object
44  * as used on the Tx side in the packet_headergenerator_bb.
45  *
46  * If only a header length is given, this block uses the default header
47  * format.
48  */
50  {
51  public:
52  typedef boost::shared_ptr<packet_headerparser_b> sptr;
53 
54  /*!
55  * \param header_formatter Header object. This should be the same as used for
56  * packet_headergenerator_bb.
57  */
58  static sptr make(const gr::digital::packet_header_default::sptr &header_formatter);
59 
60  /*!
61  * \param header_len Number of bytes per header
62  * \param len_tag_key Length Tag Key
63  */
64  static sptr make(long header_len, const std::string &len_tag_key);
65  };
66 
67  } // namespace digital
68 } // namespace gr
69 
70 #endif /* INCLUDED_DIGITAL_PACKET_HEADERPARSER_B_H */
71 
boost::shared_ptr< packet_headerparser_b > sptr
Definition: packet_headerparser_b.h:52
#define DIGITAL_API
Definition: gr-digital/include/gnuradio/digital/api.h:30
Post header metadata as a PMT.
Definition: packet_headerparser_b.h:49
Include this header to use the message passing features.
Definition: logger.h:131
boost::shared_ptr< packet_header_default > sptr
Definition: packet_header_default.h:53
synchronous 1:1 input to output with historyOverride work to provide the signal processing implementa...
Definition: sync_block.h:37