USRP Hardware Driver and USRP Manual Version: 4.1.0.4
UHD and USRP Manual
uhd::tx_streamer Class Referenceabstract

#include <uhd/stream.hpp>

Inheritance diagram for uhd::tx_streamer:

Public Types

typedef std::shared_ptr< tx_streamersptr
 
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
 

Detailed Description

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.

Member Typedef Documentation

◆ buffs_type

Typedef for a pointer to a single, or a collection of send buffers.

◆ sptr

typedef std::shared_ptr<tx_streamer> uhd::tx_streamer::sptr

Constructor & Destructor Documentation

◆ ~tx_streamer()

virtual uhd::tx_streamer::~tx_streamer ( void  )
virtual

Member Function Documentation

◆ get_max_num_samps()

virtual size_t uhd::tx_streamer::get_max_num_samps ( void  ) const
pure virtual

Get the max number of samples per buffer per packet.

◆ get_num_channels()

virtual size_t uhd::tx_streamer::get_num_channels ( void  ) const
pure virtual

Get the number of channels associated with this streamer.

◆ recv_async_msg()

virtual bool uhd::tx_streamer::recv_async_msg ( async_metadata_t async_metadata,
double  timeout = 0.1 
)
pure virtual

Receive an asynchronous message from this TX stream.

Parameters
async_metadatathe metadata to be filled in
timeoutthe timeout in seconds to wait for a message
Returns
true when the async_metadata is valid, false for timeout

◆ send()

virtual size_t uhd::tx_streamer::send ( const buffs_type buffs,
const size_t  nsamps_per_buff,
const tx_metadata_t metadata,
const double  timeout = 0.1 
)
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.

Parameters
buffsa vector of read-only memory containing samples
nsamps_per_buffthe number of samples to send, per buffer
metadatadata describing the buffer's contents
timeoutthe timeout in seconds to wait on a packet
Returns
the number of samples sent

The documentation for this class was generated from the following file: