From 031839052be29825e4d28b341dfc98abc9d1a903 Mon Sep 17 00:00:00 2001 From: Derek Kozel Date: Thu, 28 Jul 2016 12:19:56 -0700 Subject: utils: Added querying a sensor to uhd_usrp_probe --- host/utils/uhd_usrp_probe.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/host/utils/uhd_usrp_probe.cpp b/host/utils/uhd_usrp_probe.cpp index ae86b0dba..b19a59a8e 100644 --- a/host/utils/uhd_usrp_probe.cpp +++ b/host/utils/uhd_usrp_probe.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -206,6 +207,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ ("string", po::value(), "query a string value from the property tree") ("double", po::value(), "query a double precision floating point value from the property tree") ("int", po::value(), "query a integer value from the property tree") + ("sensor", po::value(), "query a sensor value from the property tree") ("range", po::value(), "query a range (gain, bandwidth, frequency, ...) from the property tree") ("init-only", "skip all queries, only initialize device") ; @@ -243,6 +245,11 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ return EXIT_SUCCESS; } + if (vm.count("sensor")){ + std::cout << tree->access(vm["sensor"].as()).get().value << std::endl; + return EXIT_SUCCESS; + } + if (vm.count("range")){ meta_range_t range = tree->access(vm["range"].as()).get(); std::cout << boost::format("%.1f:%.1f:%.1f") % range.start() % range.step() % range.stop() << std::endl; -- cgit v1.2.3