diff options
Diffstat (limited to 'host/utils/uhd_usrp_probe.cpp')
| -rw-r--r-- | host/utils/uhd_usrp_probe.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/host/utils/uhd_usrp_probe.cpp b/host/utils/uhd_usrp_probe.cpp index 1bd49a5ff..736490f19 100644 --- a/host/utils/uhd_usrp_probe.cpp +++ b/host/utils/uhd_usrp_probe.cpp @@ -30,6 +30,7 @@ #include <iostream> #include <sstream> #include <vector> +#include <cstdlib> namespace po = boost::program_options; using namespace uhd; @@ -69,9 +70,9 @@ static std::string prop_names_to_pp_string(const std::vector<std::string> &prop_ return ss.str(); } -static std::string get_subdev_pp_string(const std::string &type, property_tree::sptr tree, const fs_path &path){ +static std::string get_frontend_pp_string(const std::string &type, property_tree::sptr tree, const fs_path &path){ std::stringstream ss; - ss << boost::format("%s Subdev: %s") % type % path.leaf() << std::endl; + ss << boost::format("%s Frontend: %s") % type % path.leaf() << std::endl; //ss << std::endl; ss << boost::format("Name: %s") % (tree->access<std::string>(path / "name").get()) << std::endl; @@ -123,7 +124,7 @@ static std::string get_dboard_pp_string(const std::string &type, property_tree:: if (not gdb_eeprom.serial.empty()) ss << boost::format("Serial: %s") % gdb_eeprom.serial << std::endl; } BOOST_FOREACH(const std::string &name, tree->list(path / (prefix + "_frontends"))){ - ss << make_border(get_subdev_pp_string(type, tree, path / (prefix + "_frontends") / name)); + ss << make_border(get_frontend_pp_string(type, tree, path / (prefix + "_frontends") / name)); } ss << make_border(get_codec_pp_string(type, tree, path.branch_path().branch_path() / (prefix + "_codecs") / path.leaf())); return ss.str(); @@ -137,6 +138,12 @@ static std::string get_mboard_pp_string(property_tree::sptr tree, const fs_path BOOST_FOREACH(const std::string &key, mb_eeprom.keys()){ if (not mb_eeprom[key].empty()) ss << boost::format("%s: %s") % key % mb_eeprom[key] << std::endl; } + if (tree->exists(path / "fw_version")){ + ss << "FW Version: " << tree->access<std::string>(path / "fw_version").get() << std::endl; + } + if (tree->exists(path / "fpga_version")){ + 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; @@ -191,12 +198,12 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ //print the help message if (vm.count("help")){ std::cout << boost::format("UHD USRP Probe %s") % desc << std::endl; - return ~0; + return EXIT_FAILURE; } if (vm.count("version")){ std::cout << uhd::get_version_string() << std::endl; - return 0; + return EXIT_SUCCESS; } device::sptr dev = device::make(vm["args"].as<std::string>()); @@ -204,11 +211,11 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ if (vm.count("string")){ std::cout << tree->access<std::string>(vm["string"].as<std::string>()).get() << std::endl; - return 0; + return EXIT_SUCCESS; } if (vm.count("tree") != 0) print_tree("/", tree); else std::cout << make_border(get_device_pp_string(tree)) << std::endl; - return 0; + return EXIT_SUCCESS; } |
