diff options
author | Derek Kozel <derek.kozel@ettus.com> | 2016-07-28 12:19:56 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2016-08-01 18:40:41 -0700 |
commit | 031839052be29825e4d28b341dfc98abc9d1a903 (patch) | |
tree | 5bdd58c395fbb89aecd76021ced99accde92d6ec /host/utils | |
parent | b448bb331a3a09bc395d38ee8e1261b209872ba6 (diff) | |
download | uhd-031839052be29825e4d28b341dfc98abc9d1a903.tar.gz uhd-031839052be29825e4d28b341dfc98abc9d1a903.tar.bz2 uhd-031839052be29825e4d28b341dfc98abc9d1a903.zip |
utils: Added querying a sensor to uhd_usrp_probe
Diffstat (limited to 'host/utils')
-rw-r--r-- | host/utils/uhd_usrp_probe.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
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 <uhd/usrp/dboard_id.hpp> #include <uhd/usrp/mboard_eeprom.hpp> #include <uhd/usrp/dboard_eeprom.hpp> +#include <uhd/types/sensors.hpp> #include <boost/program_options.hpp> #include <boost/format.hpp> #include <boost/foreach.hpp> @@ -206,6 +207,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ ("string", po::value<std::string>(), "query a string value from the property tree") ("double", po::value<std::string>(), "query a double precision floating point value from the property tree") ("int", po::value<std::string>(), "query a integer value from the property tree") + ("sensor", po::value<std::string>(), "query a sensor value from the property tree") ("range", po::value<std::string>(), "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<uhd::sensor_value_t>(vm["sensor"].as<std::string>()).get().value << std::endl; + return EXIT_SUCCESS; + } + if (vm.count("range")){ meta_range_t range = tree->access<meta_range_t>(vm["range"].as<std::string>()).get(); std::cout << boost::format("%.1f:%.1f:%.1f") % range.start() % range.step() % range.stop() << std::endl; |