GNU Radio Manual and C++ API Reference 3.10.5.1
The Free & Open Software Radio Ecosystem
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 * SPDX-License-Identifier: GPL-3.0-or-later
7 *
8 */
9
10#ifndef INCLUDED_DIGITAL_PACKET_HEADERPARSER_B_H
11#define INCLUDED_DIGITAL_PACKET_HEADERPARSER_B_H
12
15#include <gnuradio/sync_block.h>
16
17namespace gr {
18namespace digital {
19
20/*!
21 * \brief Post header metadata as a PMT
22 * \ingroup packet_operators_blk
23 *
24 * \details
25 * In a sense, this is the inverse block to packet_headergenerator_bb.
26 * The difference is, the parsed header is not output as a stream,
27 * but as a PMT dictionary, which is published to message port with
28 * the id "header_data".
29 *
30 * The dictionary consists of the tags created by the header formatter
31 * object. You should be able to use the exact same formatter object
32 * as used on the Tx side in the packet_headergenerator_bb.
33 *
34 * If only a header length is given, this block uses the default header
35 * format.
36 */
38{
39public:
40 typedef std::shared_ptr<packet_headerparser_b> sptr;
41
42 /*!
43 * \param header_formatter Header object. This should be the same as used for
44 * packet_headergenerator_bb.
45 */
46 static sptr make(const gr::digital::packet_header_default::sptr& header_formatter);
47
48 /*!
49 * \param header_len Number of bytes per header
50 * \param len_tag_key Length Tag Key
51 */
52 static sptr make(long header_len, const std::string& len_tag_key);
53};
54
55} // namespace digital
56} // namespace gr
57
58#endif /* INCLUDED_DIGITAL_PACKET_HEADERPARSER_B_H */
std::shared_ptr< packet_header_default > sptr
Definition: packet_header_default.h:40
Post header metadata as a PMT.
Definition: packet_headerparser_b.h:38
static sptr make(const gr::digital::packet_header_default::sptr &header_formatter)
static sptr make(long header_len, const std::string &len_tag_key)
std::shared_ptr< packet_headerparser_b > sptr
Definition: packet_headerparser_b.h:40
synchronous 1:1 input to output with history
Definition: sync_block.h:26
#define DIGITAL_API
Definition: gr-digital/include/gnuradio/digital/api.h:18
GNU Radio logging wrapper.
Definition: basic_block.h:29