aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2/io_impl.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-04-05 17:42:22 -0700
committerJosh Blum <josh@joshknows.com>2010-04-05 17:42:22 -0700
commite4f75a9271cc20702444641a3e8d442e12492c11 (patch)
treea9135bfa9d4ef5b648d861e7de9c7bf989867d2c /host/lib/usrp/usrp2/io_impl.cpp
parent9c1e7c5b8804a821e9a48908e7302327e4b9070d (diff)
parent97496ace66842f9d7529793b2b202be9abe156c3 (diff)
downloaduhd-e4f75a9271cc20702444641a3e8d442e12492c11.tar.gz
uhd-e4f75a9271cc20702444641a3e8d442e12492c11.tar.bz2
uhd-e4f75a9271cc20702444641a3e8d442e12492c11.zip
Merge branch 'rework' of git@ettus.sourcerepo.com:ettus/uhd
Diffstat (limited to 'host/lib/usrp/usrp2/io_impl.cpp')
-rw-r--r--host/lib/usrp/usrp2/io_impl.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/host/lib/usrp/usrp2/io_impl.cpp b/host/lib/usrp/usrp2/io_impl.cpp
index c87884ebb..5820841d7 100644
--- a/host/lib/usrp/usrp2/io_impl.cpp
+++ b/host/lib/usrp/usrp2/io_impl.cpp
@@ -222,12 +222,12 @@ size_t usrp2_impl::recv(
){
//perform a receive if no rx data is waiting to be copied
if (asio::buffer_size(_rx_copy_buff) == 0){
+ _fragment_offset_in_samps = 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
@@ -240,6 +240,11 @@ size_t usrp2_impl::recv(
);
const boost::uint32_t *items = asio::buffer_cast<const boost::uint32_t*>(_rx_copy_buff);
+ //setup the fragment flags and offset
+ metadata.more_fragments = asio::buffer_size(buff)/io_type.size < num_samps;
+ metadata.fragment_offset = _fragment_offset_in_samps;
+ _fragment_offset_in_samps += num_samps; //set for next time
+
//copy the samples from the recv buffer
switch(io_type.tid){
case io_type_t::COMPLEX_FLOAT32: