GNU Radio Manual and C++ API Reference
3.9.1.0
The Free & Open Software Radio Ecosystem
protocol_formatter_bb.h
Go to the documentation of this file.
1
/* -*- c++ -*- */
2
/*
3
* Copyright 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_BB_H
13
#define INCLUDED_DIGITAL_PROTOCOL_FORMATTER_BB_H
14
15
#include <
gnuradio/digital/api.h
>
16
#include <
gnuradio/digital/header_format_base.h
>
17
#include <
gnuradio/tagged_stream_block.h
>
18
19
namespace
gr
{
20
namespace
digital {
21
22
/*!
23
* \brief Uses a header format object to create a header from a
24
* tagged stream packet.
25
*
26
* \ingroup packet_operators_blk
27
*
28
* \details
29
* This block takes in tagged stream and creates a header,
30
* generally for MAC-level processing. Each received tagged stream
31
* is assumed to be its own frame, so any fragmentation would be
32
* done upstream in or before the flowgraph.
33
*
34
* The header that is created and transmitted from this block. The
35
* payload should then be sent as a parallel tagged stream to be
36
* muxed together later. The header is based entirely on the \p
37
* format object, which is an object derived from the
38
* header_format_base class. All of these packet header format
39
* objects operate the same: they take in the payload data as well
40
* as possible extra metadata info about the PDU; the format
41
* object then returns the output and metadata info. This block
42
* then transmits the header vector and attaches and metadata as
43
* tags at the start of the header.
44
*
45
* \sa protocol_formatter_async
46
*/
47
class
DIGITAL_API
protocol_formatter_bb
:
virtual
public
tagged_stream_block
48
{
49
public
:
50
typedef
std::shared_ptr<protocol_formatter_bb>
sptr
;
51
52
/*!
53
* Make a packet header block using a given \p format.
54
*
55
* \param format The format object to use when creating the
56
* header for the packet. Derived from the
57
* header_format_base class.
58
* \param len_tag_key The tagged stream length key.
59
*/
60
static
sptr
make(
const
header_format_base::sptr
& format,
61
const
std::string& len_tag_key =
"packet_len"
);
62
63
virtual
void
set_header_format(
header_format_base::sptr
& format) = 0;
64
};
65
66
}
// namespace digital
67
}
// namespace gr
68
69
#endif
/* INCLUDED_DIGITAL_PROTOCOL_FORMATTER_BB_H */
gr::digital::protocol_formatter_bb
Uses a header format object to create a header from a tagged stream packet.
Definition:
protocol_formatter_bb.h:47
gr::digital::protocol_formatter_bb::sptr
std::shared_ptr< protocol_formatter_bb > sptr
Definition:
protocol_formatter_bb.h:50
tagged_stream_block.h
DIGITAL_API
#define DIGITAL_API
Definition:
gr-digital/include/gnuradio/digital/api.h:18
gr::digital::header_format_base::sptr
std::shared_ptr< header_format_base > sptr
Definition:
header_format_base.h:114
api.h
gr
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition:
basic_block.h:29
gr::tagged_stream_block
Block that operates on PDUs in form of tagged streams.
Definition:
tagged_stream_block.h:25
header_format_base.h
gr-digital
include
gnuradio
digital
protocol_formatter_bb.h
Generated by
1.8.17