Loading...
Searching...
No Matches
uhd::tx_streamer Class Referenceabstract

`#include <uhd/stream.hpp>`

Inheritance diagram for uhd::tx_streamer:
[legend]
Collaboration diagram for uhd::tx_streamer:
[legend]

## 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.

## 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.
virtual size_t | get_max_num_samps (void) const =0
| Get the max number of samples per buffer per packet.
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

## 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 ref_vector<const void*> uhd::tx_streamer::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.

## post_output_action()

virtual void uhd::tx_streamer::post_output_action | ( | const std::shared_ptr< uhd::rfnoc::action_info > & | action,
|  | const size_t | port )

pure virtual

Post an action to the output edge of the Streamer.

Parameters

  action | shared pointer to the corresponding action_info request
  port | the port to which to post the action

## 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_metadata | the metadata to be filled in
  timeout | the 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

  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

Returns
  the number of samples sent

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

- stream.hpp