diff options
author | Martin Braun <martin.braun@ettus.com> | 2017-05-15 13:55:09 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-05-15 13:55:47 -0700 |
commit | 3e7403db5d2c107bbc512a75c0d7d82e98e40496 (patch) | |
tree | 747f0128d0abd54346b562772b7e7bef0ae1fa2a | |
parent | 5d4c0ccb41f925bbc0749090c58c0d66ecf0f37a (diff) | |
download | uhd-3e7403db5d2c107bbc512a75c0d7d82e98e40496.tar.gz uhd-3e7403db5d2c107bbc512a75c0d7d82e98e40496.tar.bz2 uhd-3e7403db5d2c107bbc512a75c0d7d82e98e40496.zip |
multi_usrp: Added more checks for properties that may not exist
-rw-r--r-- | host/lib/usrp/multi_usrp.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/host/lib/usrp/multi_usrp.cpp b/host/lib/usrp/multi_usrp.cpp index 7c1963f85..0910ad59d 100644 --- a/host/lib/usrp/multi_usrp.cpp +++ b/host/lib/usrp/multi_usrp.cpp @@ -261,7 +261,8 @@ static tune_result_t tune_xx_subdev_and_dsp( * tune_request. This lo_offset is based on the requirements of the FE, and * does not reflect a user-requested lo_offset, which is handled later. */ double lo_offset = 0.0; - if (rf_fe_subtree->access<bool>("use_lo_offset").get()){ + if (rf_fe_subtree->exists("use_lo_offset") and + rf_fe_subtree->access<bool>("use_lo_offset").get()){ // If the frontend has lo_offset value and range properties, trust it // for lo_offset if (rf_fe_subtree->exists("lo_offset/value")) { @@ -1156,7 +1157,11 @@ public: } std::vector<std::string> get_rx_sensor_names(size_t chan){ - return _tree->list(rx_rf_fe_root(chan) / "sensors"); + std::vector<std::string> sensor_names; + if (_tree->exists(rx_rf_fe_root(chan) / "sensors")) { + sensor_names = _tree->list(rx_rf_fe_root(chan) / "sensors"); + } + return sensor_names; } void set_rx_dc_offset(const bool enb, size_t chan){ @@ -1496,7 +1501,11 @@ public: } std::vector<std::string> get_tx_sensor_names(size_t chan){ - return _tree->list(tx_rf_fe_root(chan) / "sensors"); + std::vector<std::string> sensor_names; + if (_tree->exists(rx_rf_fe_root(chan) / "sensors")) { + sensor_names = _tree->list(tx_rf_fe_root(chan) / "sensors"); + } + return sensor_names; } void set_tx_dc_offset(const std::complex<double> &offset, size_t chan){ |