aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2016-08-11 09:59:24 -0700
committerMartin Braun <martin.braun@ettus.com>2016-08-11 09:59:24 -0700
commit62898fc131b6dfa2e02aaf2df9564b0af6355bc8 (patch)
treedf30d68b9a5b4f4e778f6e853a7520ba401975c1 /host
parent4749dc3ea02a9068169023eb4854d574fe508ac3 (diff)
downloaduhd-62898fc131b6dfa2e02aaf2df9564b0af6355bc8.tar.gz
uhd-62898fc131b6dfa2e02aaf2df9564b0af6355bc8.tar.bz2
uhd-62898fc131b6dfa2e02aaf2df9564b0af6355bc8.zip
examples: tx_waveforms was always checking lo_lock on channel 0, regardless of channel used
Diffstat (limited to 'host')
-rw-r--r--host/examples/tx_waveforms.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/host/examples/tx_waveforms.cpp b/host/examples/tx_waveforms.cpp
index ef878722c..b2a8f944c 100644
--- a/host/examples/tx_waveforms.cpp
+++ b/host/examples/tx_waveforms.cpp
@@ -213,20 +213,22 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//Check Ref and LO Lock detect
std::vector<std::string> sensor_names;
- sensor_names = usrp->get_tx_sensor_names(0);
+ const size_t tx_sensor_chan = channel_list.empty() ? 0 : boost::lexical_cast<size_t>(channel_list[0]);
+ sensor_names = usrp->get_tx_sensor_names(tx_sensor_chan);
if (std::find(sensor_names.begin(), sensor_names.end(), "lo_locked") != sensor_names.end()) {
- uhd::sensor_value_t lo_locked = usrp->get_tx_sensor("lo_locked",0);
+ uhd::sensor_value_t lo_locked = usrp->get_tx_sensor("lo_locked", tx_sensor_chan);
std::cout << boost::format("Checking TX: %s ...") % lo_locked.to_pp_string() << std::endl;
UHD_ASSERT_THROW(lo_locked.to_bool());
}
- sensor_names = usrp->get_mboard_sensor_names(0);
+ const size_t mboard_sensor_idx = 0;
+ sensor_names = usrp->get_mboard_sensor_names(mboard_sensor_idx);
if ((ref == "mimo") and (std::find(sensor_names.begin(), sensor_names.end(), "mimo_locked") != sensor_names.end())) {
- uhd::sensor_value_t mimo_locked = usrp->get_mboard_sensor("mimo_locked",0);
+ uhd::sensor_value_t mimo_locked = usrp->get_mboard_sensor("mimo_locked", mboard_sensor_idx);
std::cout << boost::format("Checking TX: %s ...") % mimo_locked.to_pp_string() << std::endl;
UHD_ASSERT_THROW(mimo_locked.to_bool());
}
if ((ref == "external") and (std::find(sensor_names.begin(), sensor_names.end(), "ref_locked") != sensor_names.end())) {
- uhd::sensor_value_t ref_locked = usrp->get_mboard_sensor("ref_locked",0);
+ uhd::sensor_value_t ref_locked = usrp->get_mboard_sensor("ref_locked", mboard_sensor_idx);
std::cout << boost::format("Checking TX: %s ...") % ref_locked.to_pp_string() << std::endl;
UHD_ASSERT_THROW(ref_locked.to_bool());
}