GNU Radio Manual and C++ API Reference
3.8.1.0
The Free & Open Software Radio Ecosystem
protocol_parser_b.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
* 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_PACKET_PARSE_B_H
25
#define INCLUDED_DIGITAL_PACKET_PARSE_B_H
26
27
#include <
gnuradio/digital/api.h
>
28
#include <
gnuradio/digital/header_format_base.h
>
29
#include <
gnuradio/sync_block.h
>
30
31
namespace
gr
{
32
namespace
digital {
33
34
/*!
35
* \brief Block that synchronizes to a header based on a header
36
* format object class. Designed to accept hard bits and produce
37
* PDUs with packed bytes (pmt::u8vector).
38
*
39
* \ingroup packet_operators_blk
40
*
41
* \details
42
*
43
* A packet synchronizer block. This block takes in hard bits
44
* (unpacked bytes; 1's and 0's as the LSB) and finds the access
45
* code as a sync word to find the start of a frame.
46
*
47
* The block uses a format object derived from a
48
* header_format_base class.
49
*
50
* Once the frame is detected (usually through the use of an
51
* access code), the block uses the format object's parser
52
* function to decode the remaining header. Generally, as in the
53
* default header case, the header will contain the length of the
54
* frame's payload. That and anything else in the header will
55
* generally go into the PDU's meta-data dictionary.
56
*
57
* The block will output a PDU that contains frame's header info
58
* in the meta-data portion of the PDU and the payload itself. The
59
* payload is packed hard bits as taken from the input stream.
60
*
61
* \sa packet_sync_ff for a soft decision version.
62
*/
63
class
DIGITAL_API
protocol_parser_b
:
virtual
public
sync_block
64
{
65
public
:
66
typedef
boost::shared_ptr<protocol_parser_b>
sptr
;
67
68
/*!
69
* Make a packet header block using a given \p format.
70
*
71
* \param format The format object to use when reading the
72
* header.
73
*/
74
static
sptr
make(
const
header_format_base::sptr
& format);
75
};
76
77
}
// namespace digital
78
}
// namespace gr
79
80
#endif
/* INCLUDED_DIGITAL_PROTOCOL_PARSER_B_H */
gr::digital::header_format_base::sptr
boost::shared_ptr< header_format_base > sptr
Definition:
header_format_base.h:127
gr::digital::protocol_parser_b::sptr
boost::shared_ptr< protocol_parser_b > sptr
Definition:
protocol_parser_b.h:66
gr::sync_block
synchronous 1:1 input to output with history
Definition:
sync_block.h:37
DIGITAL_API
#define DIGITAL_API
Definition:
gr-digital/include/gnuradio/digital/api.h:30
gr::digital::protocol_parser_b
Block that synchronizes to a header based on a header format object class. Designed to accept hard bi...
Definition:
protocol_parser_b.h:63
sync_block.h
api.h
gr
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition:
basic_block.h:43
header_format_base.h
gr-digital
include
gnuradio
digital
protocol_parser_b.h
Generated by
1.8.16