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 |
#define _lazymin | ( | x, | |
y | |||
) | (((x) > (y))? (y) : (x)) |
typedef ref_vector<void *> recv_buffs_type |
Typedef for a pointer to a single, or a collection of recv buffers.
typedef ref_vector<const void *> send_buffs_type |
Typedef for a pointer to a single, or a collection of send buffers.
enum recv_mode_t |
enum send_mode_t |
size_t get_max_recv_samps_per_packet | ( | void | ) |
Get the maximum number of samples per packet on recv.
size_t get_max_send_samps_per_packet | ( | void | ) |
Get the maximum number of samples per packet on send.
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.
buffs | a vector of writable memory to fill with IF data |
nsamps_per_buff | the size of each buffer in number of samples |
metadata | data to fill describing the buffer |
io_type | the type of data to fill into the buffer |
recv_mode | tells recv how to load the buffer |
timeout | the timeout in seconds to wait for a packet |
|
pure virtual |
Receive and asynchronous message from the device.
async_metadata | the metadata to be filled in |
timeout | the timeout in seconds to wait for a message |
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.
buffs | a vector of read-only memory containing IF data |
nsamps_per_buff | the number of samples to send, per buffer |
metadata | data describing the buffer's contents |
io_type | the type of data loaded in the buffer |
send_mode | tells send how to unload the buffer |
timeout | the timeout in seconds to wait on a packet |