GNU Radio Manual and C++ API Reference  3.9.4.0
The Free & Open Software Radio Ecosystem
tagged_stream_to_pdu.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2013,2014 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 #ifndef INCLUDED_BLOCKS_TAGGED_STREAM_TO_PDU_H
12 #define INCLUDED_BLOCKS_TAGGED_STREAM_TO_PDU_H
13 
14 #include <gnuradio/blocks/api.h>
15 #include <gnuradio/blocks/pdu.h>
17 
18 namespace gr {
19 namespace blocks {
20 
21 /*!
22  * \brief Turns received stream data and tags into PDUs and sends
23  * them through a message port.
24  * \ingroup message_tools_blk
25  *
26  * The sent message is a PMT-pair (created by pmt::cons()). The
27  * first element is a dictionary containing all the tags. The
28  * second is a vector containing the actual data.
29  */
31 {
32 public:
33  // gr::blocks::tagged_stream_to_pdu::sptr
34  typedef std::shared_ptr<tagged_stream_to_pdu> sptr;
35 
36  /*!
37  * \brief Construct a tagged_stream_to_pdu block
38  * \param type PDU type of pdu::vector_type
39  * \param lengthtagname The name of the tag that specifies
40  * how long the packet is.
41  */
42  static sptr make(pdu::vector_type type,
43  const std::string& lengthtagname = "packet_len");
44 };
45 
46 } /* namespace blocks */
47 } /* namespace gr */
48 
49 #endif /* INCLUDED_BLOCKS_TAGGED_STREAM_TO_PDU_H */
Turns received stream data and tags into PDUs and sends them through a message port.
Definition: tagged_stream_to_pdu.h:31
std::shared_ptr< tagged_stream_to_pdu > sptr
Definition: tagged_stream_to_pdu.h:34
static sptr make(pdu::vector_type type, const std::string &lengthtagname="packet_len")
Construct a tagged_stream_to_pdu block.
Block that operates on PDUs in form of tagged streams.
Definition: tagged_stream_block.h:26
#define BLOCKS_API
Definition: gr-blocks/include/gnuradio/blocks/api.h:18
vector_type
Definition: pdu.h:22
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition: basic_block.h:29