UHD
003.000.c6c4b01e0
|
#include <device.hpp>
Public Types | |
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 } |
typedef boost::shared_ptr< device > | sptr |
typedef boost::function< device_addrs_t(const device_addr_t &)> | find_t |
typedef boost::function< sptr(const device_addr_t &)> | make_t |
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... | |
Public Member Functions | |
virtual 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)=0 |
virtual 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)=0 |
virtual size_t | get_max_send_samps_per_packet (void) const =0 |
virtual size_t | get_max_recv_samps_per_packet (void) const =0 |
virtual bool | recv_async_msg (async_metadata_t &async_metadata, double timeout=0.1)=0 |
![]() | |
obj (void) | |
obj (const obj &o) | |
template<class T > | |
obj (const T &o) | |
virtual | ~obj (void) |
obj | operator[] (const obj &key) |
obj & | operator= (const obj &val) |
obj | get_link (void) const |
const std::type_info & | type (void) const |
template<class T > | |
T | as (void) const |
Static Public Member Functions | |
static void | register_device (const find_t &find, const make_t &make) |
static device_addrs_t | find (const device_addr_t &hint) |
Find usrp devices attached to the host. More... | |
static sptr | make (const device_addr_t &hint, size_t which=0) |
Create a new usrp device from the device address hint. More... | |
The usrp device interface represents the usrp hardware. The api allows for discovery, configuration, and streaming.
typedef boost::function<device_addrs_t(const device_addr_t &)> uhd::device::find_t |
typedef boost::function<sptr(const device_addr_t &)> uhd::device::make_t |
typedef ref_vector<void *> uhd::device::recv_buffs_type |
Typedef for a pointer to a single, or a collection of recv buffers.
typedef ref_vector<const void *> uhd::device::send_buffs_type |
Typedef for a pointer to a single, or a collection of send buffers.
typedef boost::shared_ptr<device> uhd::device::sptr |
|
static |
Find usrp devices attached to the host.
The hint device address should be used to narrow down the search to particular transport types and/or transport arguments.
hint | a partially (or fully) filled in device address |
|
pure virtual |
Get the maximum number of samples per packet on recv.
|
pure virtual |
Get the maximum number of samples per packet on send.
|
static |
Create a new usrp device from the device address hint.
The make routine will call find and pick one of the results. By default, the first result will be used to create a new device. Use the which parameter as an index into the list of results.
hint | a partially (or fully) filled in device address |
which | which address to use when multiple are found |
|
pure virtual |
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 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.
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 |
Register a device into the discovery and factory system.
find | a function that discovers devices |
make | a factory function that makes a device |
|
pure virtual |
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 |