diff options
author | Daniel Jepson <daniel.jepson@ni.com> | 2018-04-06 09:33:12 -0500 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-04-10 09:58:34 -0700 |
commit | c75edc1d4829709ab379d9ff3c0ce1e444f0dcc1 (patch) | |
tree | 740e10c799c7422f66b4bf49f5b09e13478b2b30 /host | |
parent | 58fd9f8fa8b235ca19819a880bedaaf41918ea30 (diff) | |
download | uhd-c75edc1d4829709ab379d9ff3c0ce1e444f0dcc1.tar.gz uhd-c75edc1d4829709ab379d9ff3c0ce1e444f0dcc1.tar.bz2 uhd-c75edc1d4829709ab379d9ff3c0ce1e444f0dcc1.zip |
uhd: fix subdevice selection order in txrx_loopback_to_file example
Diffstat (limited to 'host')
-rw-r--r-- | host/examples/txrx_loopback_to_file.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/host/examples/txrx_loopback_to_file.cpp b/host/examples/txrx_loopback_to_file.cpp index 77f12944c..73cc7af50 100644 --- a/host/examples/txrx_loopback_to_file.cpp +++ b/host/examples/txrx_loopback_to_file.cpp @@ -251,6 +251,10 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ std::cout << boost::format("Creating the receive usrp device with: %s...") % rx_args << std::endl; uhd::usrp::multi_usrp::sptr rx_usrp = uhd::usrp::multi_usrp::make(rx_args); + //always select the subdevice first, the channel mapping affects the other settings + if (vm.count("tx-subdev")) tx_usrp->set_tx_subdev_spec(tx_subdev); + if (vm.count("rx-subdev")) rx_usrp->set_rx_subdev_spec(rx_subdev); + //detect which channels to use std::vector<std::string> tx_channel_strings; std::vector<size_t> tx_channel_nums; @@ -277,10 +281,6 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ tx_usrp->set_clock_source(ref); rx_usrp->set_clock_source(ref); - //always select the subdevice first, the channel mapping affects the other settings - if (vm.count("tx-subdev")) tx_usrp->set_tx_subdev_spec(tx_subdev); - if (vm.count("rx-subdev")) rx_usrp->set_rx_subdev_spec(rx_subdev); - std::cout << boost::format("Using TX Device: %s") % tx_usrp->get_pp_string() << std::endl; std::cout << boost::format("Using RX Device: %s") % rx_usrp->get_pp_string() << std::endl; |