summaryrefslogtreecommitdiffstats
path: root/host/lib/usrp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-10-11 10:29:33 -0700
committerJosh Blum <josh@joshknows.com>2011-11-03 20:37:12 -0700
commitfce49fd66f577b92482af6ad516944befa31b861 (patch)
tree2c58e9f23facd1b43945981f759ed1b15a5e084d /host/lib/usrp
parent0946176f513dd58407869e3b019207ff3eef24f5 (diff)
downloaduhd-fce49fd66f577b92482af6ad516944befa31b861.tar.gz
uhd-fce49fd66f577b92482af6ad516944befa31b861.tar.bz2
uhd-fce49fd66f577b92482af6ad516944befa31b861.zip
uhd: added one packet mode to rx streamer
Diffstat (limited to 'host/lib/usrp')
-rw-r--r--host/lib/usrp/usrp1/io_impl.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/host/lib/usrp/usrp1/io_impl.cpp b/host/lib/usrp/usrp1/io_impl.cpp
index c199e4178..a0fdfc6bf 100644
--- a/host/lib/usrp/usrp1/io_impl.cpp
+++ b/host/lib/usrp/usrp1/io_impl.cpp
@@ -325,13 +325,14 @@ public:
const rx_streamer::buffs_type &buffs,
const size_t nsamps_per_buff,
uhd::rx_metadata_t &metadata,
- double timeout
+ const double timeout,
+ const bool one_packet
){
//interleave a "soft" inline message into the receive stream:
if (_stc->get_inline_queue().pop_with_haste(metadata)) return 0;
size_t num_samps_recvd = sph::recv_packet_handler::recv(
- buffs, nsamps_per_buff, metadata, timeout
+ buffs, nsamps_per_buff, metadata, timeout, one_packet
);
return _stc->recv_post(metadata, num_samps_recvd);
@@ -366,8 +367,9 @@ public:
const tx_streamer::buffs_type &buffs,
const size_t nsamps_per_buff,
const uhd::tx_metadata_t &metadata,
- double timeout
+ const double timeout_
){
+ double timeout = timeout_; //rw copy
_stc->send_pre(metadata, timeout);
_tx_enb_fcn(true); //always enable (it will do the right thing)
@@ -545,7 +547,10 @@ rx_streamer::sptr usrp1_impl::get_rx_stream(const uhd::stream_args_t &args_){
//setup defaults for unspecified values
args.otw_format = args.otw_format.empty()? "sc16" : args.otw_format;
- args.channels = args.channels.empty()? std::vector<size_t>(1, 0) : args.channels;
+ args.channels.clear(); //NOTE: we have no choice about the channel mapping
+ for (size_t ch = 0; ch < _rx_subdev_spec.size(); ch++){
+ args.channels.push_back(ch);
+ }
if (args.otw_format == "sc16"){
_iface->poke32(FR_RX_FORMAT, 0
@@ -610,7 +615,10 @@ tx_streamer::sptr usrp1_impl::get_tx_stream(const uhd::stream_args_t &args_){
//setup defaults for unspecified values
args.otw_format = args.otw_format.empty()? "sc16" : args.otw_format;
- args.channels = args.channels.empty()? std::vector<size_t>(1, 0) : args.channels;
+ args.channels.clear(); //NOTE: we have no choice about the channel mapping
+ for (size_t ch = 0; ch < _tx_subdev_spec.size(); ch++){
+ args.channels.push_back(ch);
+ }
if (args.otw_format != "sc16"){
throw uhd::value_error("USRP1 TX cannot handle requested wire format: " + args.otw_format);