GNU Radio C++ API Reference  gcd20ee2
The Free & Open Software Radio Ecosystem
rfnoc_tx_streamer.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2019 Ettus Research, a National Instruments Brand.
4  * Copyright 2020 Free Software Foundation, Inc.
5  *
6  * SPDX-License-Identifier: GPL-3.0-or-later
7  */
8 
9 #ifndef INCLUDED_GR_UHD_RFNOC_TX_STREAMER_H
10 #define INCLUDED_GR_UHD_RFNOC_TX_STREAMER_H
11 
12 #include <gnuradio/sync_block.h>
13 #include <gnuradio/uhd/api.h>
15 #include <uhd/stream.hpp>
16 
17 namespace gr {
18 namespace uhd {
19 
20 /*! RFNoC Tx Streamer: Block to handle data flow from a GNU Radio flow graph
21  * into an RFNoC flow graph.
22  *
23  * Use this block for egress from a GNU Radio flow graph. "Tx" is from the
24  * viewpoint of the GNU Radio flow graph. For example, if the GNU Radio flow
25  * graph is creating samples to be transmitted to a radio, use this block to
26  * transport the samples out of GNU Radio.
27  *
28  * The input data type is determined by the stream_args passed to the make()
29  * function. The input signature will be set to match the cpu_format field of
30  * the stream_args. The input signature will be num_chans inputs of the
31  * specified type, each with a vector length of vlen.
32  *
33  * This block also has a message input port called "in". This port accepts PDUs
34  * containing the data to be sent to RFNoC. The data part of the PDU
35  * (mostly likely a PMT vector) must match the cpu_format and vlen of the
36  * block. The data will be sent to RFNoC using the underlying RFNoC streamer
37  * associated with this block.
38  *
39  * Note: The output ports of this block can only connect to other RFNoC blocks.
40  *
41  * \ingroup rfnoc
42  */
44 {
45 public:
46  typedef std::shared_ptr<rfnoc_tx_streamer> sptr;
47 
48  /*!
49  * \param graph Reference to the graph this block is connected to
50  * \param num_chans Number of input- and output ports
51  * \param stream_args These will be passed on to
52  * rfnoc_graph::create_tx_streamer, see that for details.
53  * The cpu_format and otw_format parts of these args will
54  * be used to determine the in- and output signatures of
55  * this block.
56  * \param vlen Vector length
57  */
58  static sptr make(rfnoc_graph::sptr graph,
59  const size_t num_chans,
60  const ::uhd::stream_args_t& stream_args,
61  const size_t vlen = 1);
62 
63  //! Return the unique ID associated with the underlying RFNoC streamer
64  virtual std::string get_unique_id() const = 0;
65 };
66 
67 } // namespace uhd
68 } // namespace gr
69 
70 #endif /* INCLUDED_GR_UHD_RFNOC_TX_STREAMER_H */
synchronous 1:1 input to output with history
Definition: sync_block.h:26
std::shared_ptr< rfnoc_graph > sptr
Definition: rfnoc_graph.h:32
Definition: rfnoc_tx_streamer.h:44
static sptr make(rfnoc_graph::sptr graph, const size_t num_chans, const ::uhd::stream_args_t &stream_args, const size_t vlen=1)
virtual std::string get_unique_id() const =0
Return the unique ID associated with the underlying RFNoC streamer.
std::shared_ptr< rfnoc_tx_streamer > sptr
Definition: rfnoc_tx_streamer.h:46
#define GR_UHD_API
Definition: gr-uhd/include/gnuradio/uhd/api.h:18
GNU Radio logging wrapper.
Definition: basic_block.h:29