diff options
author | Josh Blum <josh@joshknows.com> | 2010-03-03 11:28:32 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-03-03 11:28:32 -0800 |
commit | ccd2665a29af046b0b8a11c48ffbfe2ed36ce8d9 (patch) | |
tree | 0ebf3fda5a9f7f973872bd99bb62386d18c93941 /host/lib/usrp/usrp2/io_impl.cpp | |
parent | e531f936e6ffa645a944b360a51f82004c6cdfcb (diff) | |
download | uhd-ccd2665a29af046b0b8a11c48ffbfe2ed36ce8d9.tar.gz uhd-ccd2665a29af046b0b8a11c48ffbfe2ed36ce8d9.tar.bz2 uhd-ccd2665a29af046b0b8a11c48ffbfe2ed36ce8d9.zip |
Split metadata into rx and tx specific metadata.
The rx metadata has fragment flags and the tx metatdata has burst flags.
Made the io impl for usrp2 rx routine fill in the rx metatdata fragment flag.
Added device documentation for send and recv in regards to fragmentation.
Diffstat (limited to 'host/lib/usrp/usrp2/io_impl.cpp')
-rw-r--r-- | host/lib/usrp/usrp2/io_impl.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/host/lib/usrp/usrp2/io_impl.cpp b/host/lib/usrp/usrp2/io_impl.cpp index 642b6b08b..5529cfe57 100644 --- a/host/lib/usrp/usrp2/io_impl.cpp +++ b/host/lib/usrp/usrp2/io_impl.cpp @@ -119,7 +119,7 @@ static inline void usrp2_items_to_host_items( /*********************************************************************** * Receive Raw Data **********************************************************************/ -void usrp2_impl::recv_raw(uhd::metadata_t &metadata){ +void usrp2_impl::recv_raw(rx_metadata_t &metadata){ //do a receive _rx_smart_buff = _data_transport->recv(); @@ -161,8 +161,8 @@ void usrp2_impl::recv_raw(uhd::metadata_t &metadata){ * Send Data **********************************************************************/ size_t usrp2_impl::send( - const boost::asio::const_buffer &buff, - const uhd::metadata_t &metadata, + const asio::const_buffer &buff, + const tx_metadata_t &metadata, const std::string &type ){ uint32_t tx_mem[_mtu/sizeof(uint32_t)]; @@ -210,13 +210,19 @@ size_t usrp2_impl::send( * Receive Data **********************************************************************/ size_t usrp2_impl::recv( - const boost::asio::mutable_buffer &buff, - uhd::metadata_t &metadata, + const asio::mutable_buffer &buff, + rx_metadata_t &metadata, const std::string &type ){ //perform a receive if no rx data is waiting to be copied - if (asio::buffer_size(_rx_copy_buff) == 0) recv_raw(metadata); - //TODO otherwise flag the metadata to show that is is a fragment + if (asio::buffer_size(_rx_copy_buff) == 0){ + recv_raw(metadata); + } + //otherwise flag the metadata to show that is is a fragment + else{ + metadata = rx_metadata_t(); + metadata.is_fragment = true; + } //extract the number of samples available to copy //and a pointer into the usrp2 received items memory |