aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2016-06-14 18:24:54 -0700
committerMartin Braun <martin.braun@ettus.com>2016-06-15 09:37:36 -0700
commitab8d81bc3372cd17800377717470283401d7aafa (patch)
tree6af3da2f5d94535bee05e60616a1e89a743f881b /host
parent938a1b5c9fdeba069a060733f4a6f84dce1762c6 (diff)
downloaduhd-ab8d81bc3372cd17800377717470283401d7aafa.tar.gz
uhd-ab8d81bc3372cd17800377717470283401d7aafa.tar.bz2
uhd-ab8d81bc3372cd17800377717470283401d7aafa.zip
octoclock: uhd_usrp_probe works for clocks now
Diffstat (limited to 'host')
-rw-r--r--host/utils/uhd_usrp_probe.cpp39
1 files changed, 25 insertions, 14 deletions
diff --git a/host/utils/uhd_usrp_probe.cpp b/host/utils/uhd_usrp_probe.cpp
index f8a8b5665..4a84fef55 100644
--- a/host/utils/uhd_usrp_probe.cpp
+++ b/host/utils/uhd_usrp_probe.cpp
@@ -149,20 +149,31 @@ static std::string get_mboard_pp_string(property_tree::sptr tree, const fs_path
ss << "FPGA Version: " << tree->access<std::string>(path / "fpga_version").get() << std::endl;
}
ss << std::endl;
- ss << "Time sources: " << prop_names_to_pp_string(tree->access<std::vector<std::string> >(path / "time_source" / "options").get()) << std::endl;
- ss << "Clock sources: " << prop_names_to_pp_string(tree->access<std::vector<std::string> >(path / "clock_source" / "options").get()) << std::endl;
- ss << "Sensors: " << prop_names_to_pp_string(tree->list(path / "sensors")) << std::endl;
- BOOST_FOREACH(const std::string &name, tree->list(path / "rx_dsps")){
- ss << make_border(get_dsp_pp_string("RX", tree, path / "rx_dsps" / name));
- }
- BOOST_FOREACH(const std::string &name, tree->list(path / "dboards")){
- ss << make_border(get_dboard_pp_string("RX", tree, path / "dboards" / name));
- }
- BOOST_FOREACH(const std::string &name, tree->list(path / "tx_dsps")){
- ss << make_border(get_dsp_pp_string("TX", tree, path / "tx_dsps" / name));
+ try {
+ if (tree->exists(path / "time_source" / "options")){
+ const std::vector< std::string > time_sources = tree->access<std::vector<std::string> >(path / "time_source" / "options").get();
+ ss << "Time sources: " << prop_names_to_pp_string(time_sources) << std::endl;
+ }
+ if (tree->exists(path / "clock_source" / "options")){
+ const std::vector< std::string > clock_sources = tree->access<std::vector<std::string> >(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;
+ BOOST_FOREACH(const std::string &name, tree->list(path / "rx_dsps")){
+ ss << make_border(get_dsp_pp_string("RX", tree, path / "rx_dsps" / name));
+ }
+ BOOST_FOREACH(const std::string &name, tree->list(path / "dboards")){
+ ss << make_border(get_dboard_pp_string("RX", tree, path / "dboards" / name));
+ }
+ BOOST_FOREACH(const std::string &name, tree->list(path / "tx_dsps")){
+ ss << make_border(get_dsp_pp_string("TX", tree, path / "tx_dsps" / name));
+ }
+ BOOST_FOREACH(const std::string &name, tree->list(path / "dboards")){
+ ss << make_border(get_dboard_pp_string("TX", tree, path / "dboards" / name));
+ }
}
- BOOST_FOREACH(const std::string &name, tree->list(path / "dboards")){
- ss << make_border(get_dboard_pp_string("TX", tree, path / "dboards" / name));
+ catch (const uhd::lookup_error &e) {
+ /* nop */
}
return ss.str();
}
@@ -214,7 +225,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
return EXIT_SUCCESS;
}
- device::sptr dev = device::make(vm["args"].as<std::string>(), device::USRP);
+ device::sptr dev = device::make(vm["args"].as<std::string>());
property_tree::sptr tree = dev->get_tree();
if (vm.count("string")){