#include <uhd/stream.hpp>
The TX streamer is the host interface to transmitting samples. It represents the layer between the samples on the host and samples inside the device's transmit DSP processing.
Public Types | |
| typedef std::shared_ptr< tx_streamer > | sptr |
| typedef ref_vector< const void * > | buffs_type |
| Typedef for a pointer to a single, or a collection of send buffers. More... | |
Public Member Functions | |
| virtual | ~tx_streamer (void) |
| virtual size_t | get_num_channels (void) const =0 |
| Get the number of channels associated with this streamer. More... | |
| virtual size_t | get_max_num_samps (void) const =0 |
| Get the max number of samples per buffer per packet. More... | |
| virtual size_t | send (const buffs_type &buffs, const size_t nsamps_per_buff, const tx_metadata_t &metadata, const double timeout=0.1)=0 |
| virtual bool | recv_async_msg (async_metadata_t &async_metadata, double timeout=0.1)=0 |
| virtual void | post_output_action (const std::shared_ptr< uhd::rfnoc::action_info > &action, const size_t port)=0 |
| virtual device_addr_t | get_stream_info (const size_t chan=0) const =0 |
| typedef ref_vector<const void*> uhd::tx_streamer::buffs_type |
Typedef for a pointer to a single, or a collection of send buffers.
| typedef std::shared_ptr<tx_streamer> uhd::tx_streamer::sptr |
|
virtual |
|
pure virtual |
Get the max number of samples per buffer per packet.
|
pure virtual |
Get the number of channels associated with this streamer.
|
pure virtual |
Return information about the current streamer object
The contents of the returned dictionary depend on the current hardware setup, the arguments with which this streamer was created, etc.
| chan | The channel number for which to get stream info |
|
pure virtual |
Post an action to the output edge of the Streamer.
| action | shared pointer to the corresponding action_info request |
| port | the port to which to post the action |
|
pure virtual |
Receive an asynchronous message from this TX stream.
| async_metadata | the metadata to be filled in |
| timeout | the timeout in seconds to wait for a message |
|
pure virtual |
Send buffers containing samples described by the metadata.
Send handles fragmentation as follows: If the buffer has more items than the maximum per packet, the send method will fragment the samples across several packets. Send will respect the burst flags when fragmenting to ensure that start of burst can only be set on the first fragment and that end of burst can only be set on the final fragment.
This is a blocking call and will not return until the number of samples returned have been read out of each buffer. Under a timeout condition, the number of samples returned may be less than the number of samples specified.
Note on threading: send() is not thread-safe, to avoid locking overhead. The application calling send() is responsible for making sure that not more than one thread can call send() on the same streamer at the same time. If there are multiple streamers, transmitting to different destinations, then those may be called from different threads simultaneously.
| buffs | a vector of read-only memory containing samples |
| nsamps_per_buff | the number of samples to send, per buffer |
| metadata | data describing the buffer's contents |
| timeout | the timeout in seconds to wait on a packet |