GNU Radio Manual and C++ API Reference
3.8.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
* GNU Radio is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 3, or (at your option)
10
* any later version.
11
*
12
* GNU Radio is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with GNU Radio; see the file COPYING. If not, write to
19
* the Free Software Foundation, Inc., 51 Franklin Street,
20
* Boston, MA 02110-1301, USA.
21
*/
22
23
24
#ifndef INCLUDED_DIGITAL_PROTOCOL_FORMATTER_BB_H
25
#define INCLUDED_DIGITAL_PROTOCOL_FORMATTER_BB_H
26
27
#include <
gnuradio/digital/api.h
>
28
#include <
gnuradio/digital/header_format_base.h
>
29
#include <
gnuradio/tagged_stream_block.h
>
30
31
namespace
gr
{
32
namespace
digital {
33
34
/*!
35
* \brief Uses a header format object to create a header from a
36
* tagged stream packet.
37
*
38
* \ingroup packet_operators_blk
39
*
40
* \details
41
* This block takes in tagged stream and creates a header,
42
* generally for MAC-level processing. Each received tagged stream
43
* is assumed to be its own frame, so any fragmentation would be
44
* done upstream in or before the flowgraph.
45
*
46
* The header that is created and transmitted from this block. The
47
* payload should then be sent as a parallel tagged stream to be
48
* muxed together later. The header is based entirely on the \p
49
* format object, which is an object derived from the
50
* header_format_base class. All of these packet header format
51
* objects operate the same: they take in the payload data as well
52
* as possible extra metadata info about the PDU; the format
53
* object then returns the output and metadata info. This block
54
* then transmits the header vector and attaches and metadata as
55
* tags at the start of the header.
56
*
57
* \sa protocol_formatter_async
58
*/
59
class
DIGITAL_API
protocol_formatter_bb
:
virtual
public
tagged_stream_block
60
{
61
public
:
62
typedef
boost::shared_ptr<protocol_formatter_bb>
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. Derived from the
69
* header_format_base class.
70
* \param len_tag_key The tagged stream length key.
71
*/
72
static
sptr
make(
const
header_format_base::sptr
& format,
73
const
std::string& len_tag_key =
"packet_len"
);
74
75
virtual
void
set_header_format(
header_format_base::sptr
& format) = 0;
76
};
77
78
}
// namespace digital
79
}
// namespace gr
80
81
#endif
/* INCLUDED_DIGITAL_PROTOCOL_FORMATTER_BB_H */
gr::digital::header_format_base::sptr
boost::shared_ptr< header_format_base > sptr
Definition:
header_format_base.h:127
gr::digital::protocol_formatter_bb
Uses a header format object to create a header from a tagged stream packet.
Definition:
protocol_formatter_bb.h:59
tagged_stream_block.h
gr::digital::protocol_formatter_bb::sptr
boost::shared_ptr< protocol_formatter_bb > sptr
Definition:
protocol_formatter_bb.h:62
DIGITAL_API
#define DIGITAL_API
Definition:
gr-digital/include/gnuradio/digital/api.h:30
api.h
gr
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition:
basic_block.h:43
gr::tagged_stream_block
Block that operates on PDUs in form of tagged streams.
Definition:
tagged_stream_block.h:37
header_format_base.h
gr-digital
include
gnuradio
digital
protocol_formatter_bb.h
Generated by
1.8.16