From c88be9542d82798260feb55b0ee5500ff94713cd Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Wed, 3 May 2017 15:58:26 -0700 Subject: utils: Updated uhd_usrp_probe to be more lenient with missing properties --- host/utils/uhd_usrp_probe.cpp | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/host/utils/uhd_usrp_probe.cpp b/host/utils/uhd_usrp_probe.cpp index 5bb2ead5e..dc0f98832 100644 --- a/host/utils/uhd_usrp_probe.cpp +++ b/host/utils/uhd_usrp_probe.cpp @@ -179,24 +179,30 @@ static std::string get_mboard_pp_string(property_tree::sptr tree, const fs_path const std::vector< std::string > clock_sources = tree->access >(path / "clock_source" / "options").get(); ss << "Clock sources: " << prop_names_to_pp_string(clock_sources) << std::endl; } - ss << "Sensors: " << prop_names_to_pp_string(tree->list(path / "sensors")) << std::endl; + if (tree->exists(path / "sensors")){ + ss << "Sensors: " << prop_names_to_pp_string(tree->list(path / "sensors")) << std::endl; + } if (tree->exists(path / "rx_dsps")){ for(const std::string &name: tree->list(path / "rx_dsps")){ ss << make_border(get_dsp_pp_string("RX", tree, path / "rx_dsps" / name)); } } - for(const std::string &name: tree->list(path / "dboards")){ - ss << make_border(get_dboard_pp_string("RX", tree, path / "dboards" / name)); - } - if (tree->exists(path / "tx_dsps")){ - for(const std::string &name: tree->list(path / "tx_dsps")){ - ss << make_border(get_dsp_pp_string("TX", tree, path / "tx_dsps" / name)); + if (tree->exists(path / "dboards")) { + for(const std::string &name: tree->list(path / "dboards")){ + ss << make_border(get_dboard_pp_string("RX", tree, path / "dboards" / name)); + } + if (tree->exists(path / "tx_dsps")){ + for(const std::string &name: tree->list(path / "tx_dsps")){ + ss << make_border(get_dsp_pp_string("TX", tree, path / "tx_dsps" / name)); + } + } + for(const std::string &name: tree->list(path / "dboards")){ + ss << make_border(get_dboard_pp_string("TX", tree, path / "dboards" / name)); } } - for(const std::string &name: tree->list(path / "dboards")){ - ss << make_border(get_dboard_pp_string("TX", tree, path / "dboards" / name)); - } + if (tree->exists(path / "xbar")){ ss << make_border(get_rfnoc_pp_string(tree, path / "xbar")); + } } catch (const uhd::lookup_error&) { /* nop */ -- cgit v1.2.3