diff options
author | Josh Blum <josh@joshknows.com> | 2010-04-03 19:43:20 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-04-03 19:43:20 -0700 |
commit | 83bd55d63972804e62f3890a4a90c8288fcbad0c (patch) | |
tree | b5bf6a8877b37b238f9f540b0b77d1425ed619b9 /host/lib/usrp/usrp2/io_impl.cpp | |
parent | f4ccb204473884126bcff6551d224e263dd5102a (diff) | |
download | uhd-83bd55d63972804e62f3890a4a90c8288fcbad0c.tar.gz uhd-83bd55d63972804e62f3890a4a90c8288fcbad0c.tar.bz2 uhd-83bd55d63972804e62f3890a4a90c8288fcbad0c.zip |
extended stream cmd with mode enum, and extended fragment flags in metadata
Diffstat (limited to 'host/lib/usrp/usrp2/io_impl.cpp')
-rw-r--r-- | host/lib/usrp/usrp2/io_impl.cpp | 7 |
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: |