USRP Hardware Driver and USRP Manual  Version: 003.010.000.HEAD-0-g6e1ac3fc
UHD and USRP Manual
device_deprecated.ipp File Reference

Macros

#define _lazymin(x, y)   (((x) > (y))? (y) : (x))
 

Typedefs

typedef ref_vector< const void * > send_buffs_type
 Typedef for a pointer to a single, or a collection of send buffers. More...
 
typedef ref_vector< void * > recv_buffs_type
 Typedef for a pointer to a single, or a collection of recv buffers. More...
 

Enumerations

enum  send_mode_t { SEND_MODE_FULL_BUFF = 0, SEND_MODE_ONE_PACKET = 1 }
 
enum  recv_mode_t { RECV_MODE_FULL_BUFF = 0, RECV_MODE_ONE_PACKET = 1 }
 

Functions

size_t send (const send_buffs_type &buffs, size_t nsamps_per_buff, const tx_metadata_t &metadata, const io_type_t &io_type, send_mode_t send_mode, double timeout=0.1)
 
size_t recv (const recv_buffs_type &buffs, size_t nsamps_per_buff, rx_metadata_t &metadata, const io_type_t &io_type, recv_mode_t recv_mode, double timeout=0.1)
 
size_t get_max_send_samps_per_packet (void)
 
size_t get_max_recv_samps_per_packet (void)
 
virtual bool recv_async_msg (async_metadata_t &async_metadata, double timeout=0.1)=0
 

Macro Definition Documentation

◆ _lazymin

#define _lazymin (   x,
 
)    (((x) > (y))? (y) : (x))

Typedef Documentation

◆ recv_buffs_type

typedef ref_vector<void *> recv_buffs_type

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

◆ send_buffs_type

typedef ref_vector<const void *> send_buffs_type

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

Enumeration Type Documentation

◆ recv_mode_t

Recv modes for the device recv routine.

Enumerator
RECV_MODE_FULL_BUFF 

Tells the recv routine to recv the entire buffer.

RECV_MODE_ONE_PACKET 

Tells the recv routine to return after one packet.

◆ send_mode_t

Send modes for the device send routine.

Enumerator
SEND_MODE_FULL_BUFF 

Tells the send routine to send the entire buffer.

SEND_MODE_ONE_PACKET 

Tells the send routine to return after one packet.

Function Documentation

◆ get_max_recv_samps_per_packet()

size_t get_max_recv_samps_per_packet ( void  )

Get the maximum number of samples per packet on recv.

Returns
the number of samples

◆ get_max_send_samps_per_packet()

size_t get_max_send_samps_per_packet ( void  )

Get the maximum number of samples per packet on send.

Returns
the number of samples

◆ recv()

size_t recv ( const recv_buffs_type buffs,
size_t  nsamps_per_buff,
rx_metadata_t &  metadata,
const io_type_t &  io_type,
recv_mode_t  recv_mode,
double  timeout = 0.1 
)

Receive buffers containing IF data 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 exhausted, 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.

When using the full buffer recv mode, the metadata only applies to the first packet received and written into the recv buffers. Use the one packet recv mode to get per packet metadata.

Parameters
buffsa vector of writable memory to fill with IF data
nsamps_per_buffthe size of each buffer in number of samples
metadatadata to fill describing the buffer
io_typethe type of data to fill into the buffer
recv_modetells recv how to load the buffer
timeoutthe timeout in seconds to wait for a packet
Returns
the number of samples received or 0 on error

◆ recv_async_msg()

virtual bool recv_async_msg ( async_metadata_t &  async_metadata,
double  timeout = 0.1 
)
pure virtual

Receive and asynchronous message from the device.

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()

size_t send ( const send_buffs_type buffs,
size_t  nsamps_per_buff,
const tx_metadata_t &  metadata,
const io_type_t &  io_type,
send_mode_t  send_mode,
double  timeout = 0.1 
)

Send buffers containing IF data described by the metadata.

Send handles fragmentation as follows: If the buffer has more samples 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. Fragmentation only applies in the full buffer send mode.

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.

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