GNU Radio Manual and C++ API Reference 3.10.5.1
The Free & Open Software Radio Ecosystem
protocol_formatter_async.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2015-2016 Free Software Foundation, Inc.
4 *
5 * This file is part of GNU Radio
6 *
7 * SPDX-License-Identifier: GPL-3.0-or-later
8 *
9 */
10
11
12#ifndef INCLUDED_DIGITAL_PROTOCOL_FORMATTER_ASYNC_H
13#define INCLUDED_DIGITAL_PROTOCOL_FORMATTER_ASYNC_H
14
15#include <gnuradio/block.h>
18
19namespace gr {
20namespace digital {
21
22/*!
23 * \brief Uses a header format object to append a header onto a
24 * PDU.
25 *
26 * \ingroup packet_operators_blk
27 *
28 * \details
29 * This block takes in PDUs and creates a header, generally for
30 * MAC-level processing. Each received PDU is assumed to be its
31 * own frame, so any fragmentation would be done upstream in or
32 * before the flowgraph.
33 *
34 * The header that is created and transmitted out of the 'header'
35 * message port as a PDU. The header is based entirely on the \p
36 * format object, which is an object derived from the
37 * header_format_base class. All of these packet header format
38 * objects operate the same: they take in the payload data as well
39 * as possible extra metadata info about the PDU; the format
40 * object then returns the output PDU as a PMT argument along
41 * with any changes to the metadata info PMT.
42 *
43 * For different packet header formatting needs, we can define new
44 * classes that inherit from the header_format_base block
45 * and which overload the header_format_base::format
46 * function.
47 *
48 * \sa header_format_base
49 * \sa header_format_default
50 * \sa header_format_counter
51 *
52 * This block only uses asynchronous message passing interfaces to
53 * receiver and emit PDUs. The message ports are:
54 *
55 * \li in: receives PDUs for the frame payload
56 * \li header: the header formatted for the given frame
57 * \li payload: the payload
58 */
60{
61public:
62 typedef std::shared_ptr<protocol_formatter_async> sptr;
63
64 /*!
65 * Make a packet header block using a given \p format.
66 *
67 * \param format The format object to use when creating the
68 * header for the packet.
69 */
70 static sptr make(const header_format_base::sptr& format);
71};
72
73} // namespace digital
74} // namespace gr
75
76#endif /* INCLUDED_DIGITAL_PROTOCOL_FORMATTER_ASYNC_H */
The abstract base class for all 'terminal' processing blocks.
Definition: gnuradio-runtime/include/gnuradio/block.h:63
std::shared_ptr< header_format_base > sptr
Definition: header_format_base.h:114
Uses a header format object to append a header onto a PDU.
Definition: protocol_formatter_async.h:60
static sptr make(const header_format_base::sptr &format)
std::shared_ptr< protocol_formatter_async > sptr
Definition: protocol_formatter_async.h:62
#define DIGITAL_API
Definition: gr-digital/include/gnuradio/digital/api.h:18
GNU Radio logging wrapper.
Definition: basic_block.h:29