From 8315ab86b172b21f24ecf84ce472bcaffe245f99 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 17 Aug 2011 10:30:35 -0700 Subject: uhd: added readback of version and arbitrary string property to probe app --- host/utils/uhd_usrp_probe.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'host/utils/uhd_usrp_probe.cpp') diff --git a/host/utils/uhd_usrp_probe.cpp b/host/utils/uhd_usrp_probe.cpp index 55b9e3ddd..1bd49a5ff 100644 --- a/host/utils/uhd_usrp_probe.cpp +++ b/host/utils/uhd_usrp_probe.cpp @@ -16,6 +16,7 @@ // #include +#include #include #include #include @@ -177,8 +178,10 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ po::options_description desc("Allowed options"); desc.add_options() ("help", "help message") + ("version", "print the version string and exit") ("args", po::value()->default_value(""), "device address args") ("tree", "specify to print a complete property tree") + ("string", po::value(), "query a string value from the properties tree") ; po::variables_map vm; @@ -191,9 +194,19 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ return ~0; } + if (vm.count("version")){ + std::cout << uhd::get_version_string() << std::endl; + return 0; + } + device::sptr dev = device::make(vm["args"].as()); property_tree::sptr tree = dev->get_tree(); + if (vm.count("string")){ + std::cout << tree->access(vm["string"].as()).get() << std::endl; + return 0; + } + if (vm.count("tree") != 0) print_tree("/", tree); else std::cout << make_border(get_device_pp_string(tree)) << std::endl; -- cgit v1.2.3