UHD 003.004.003-0-unknown

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Types | Public Member Functions | List of all members
uhd::rx_streamer Class Referenceabstract

`#include <stream.hpp>`

Inheritance diagram for uhd::rx_streamer:

## Public Types
typedef boost::shared_ptr < rx_streamer > | sptr
typedef ref_vector< void * > | buffs_type
| Typedef for a pointer to a single, or a collection of recv buffers. More...

## Public Member Functions
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 | recv (const buffs_type &buffs, const size_t nsamps_per_buff, rx_metadata_t &metadata, const double timeout=0.1, const bool one_packet=false)=0

## Detailed Description

The RX streamer is the host interface to receiving samples. It represents the layer between the samples on the host and samples inside the device's receive DSP processing.

## Member Typedef Documentation

typedef ref_vector<void *> uhd::rx_streamer::buffs_type

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

typedef boost::shared_ptr<rx_streamer> uhd::rx_streamer::sptr

## Member Function Documentation

virtual size_t uhd::rx_streamer::get_max_num_samps | ( | void |  | ) | const
| pure virtual

Get the max number of samples per buffer per packet.

virtual size_t uhd::rx_streamer::get_num_channels | ( | void |  | ) | const
| pure virtual

Get the number of channels associated with this streamer.

virtual size_t uhd::rx_streamer::recv | ( | const buffs_type & | buffs,
|  | const size_t | nsamps_per_buff,
|  | rx_metadata_t & | metadata,
|  | const double | timeout = `0.1`,
|  | const bool | one_packet = `false`
| ) |  |
| pure virtual

Receive buffers containing samples described by the metadata.

Receive handles fragmentation as follows: If the buffer has insufficient space to hold all samples that were received in a single packet over-the-wire, then the buffer will be completely filled and the implementation will hold a pointer into the remaining portion of the packet. Subsequent calls will load from the remainder of the packet, and will flag the metadata to show that this is a fragment. The next call to receive, after the remainder becomes exahausted, will perform an over-the-wire receive as usual. See the rx metadata fragment flags and offset fields for details.

This is a blocking call and will not return until the number of samples returned have been written into each buffer. Under a timeout condition, the number of samples returned may be less than the number of samples specified.

The one_packet option allows the user to guarantee that the call will return after a single packet has been processed. This may be useful to maintain packet boundaries in some cases.

Parameters

  buffs | a vector of writable memory to fill with samples
  nsamps_per_buff | the size of each buffer in number of samples
  metadata | data to fill describing the buffer
  timeout | the timeout in seconds to wait for a packet
  one_packet | return after the first packet is received

Returns
  the number of samples received or 0 on error

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

- include/uhd/stream.hpp