diff options
author | Martin Braun <martin.braun@ettus.com> | 2016-09-27 17:13:13 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2016-09-27 17:13:13 -0700 |
commit | a9c83aca8f95a408c06fbdf470f69b71514a5f46 (patch) | |
tree | 0ad7ad28f4084831f65db0e4738b788f9338ebf9 /host/utils | |
parent | f70dd85daa8a6b9e1762c9339532027e40a67018 (diff) | |
parent | 102b03f59afdfd3bc633639a1a126bfdff57af45 (diff) | |
download | uhd-a9c83aca8f95a408c06fbdf470f69b71514a5f46.tar.gz uhd-a9c83aca8f95a408c06fbdf470f69b71514a5f46.tar.bz2 uhd-a9c83aca8f95a408c06fbdf470f69b71514a5f46.zip |
Merge branch 'maint'
Diffstat (limited to 'host/utils')
-rw-r--r-- | host/utils/CMakeLists.txt | 3 | ||||
-rw-r--r-- | host/utils/uhd_usrp_probe.cpp | 12 |
2 files changed, 14 insertions, 1 deletions
diff --git a/host/utils/CMakeLists.txt b/host/utils/CMakeLists.txt index 6f72c97bc..eb5a29df9 100644 --- a/host/utils/CMakeLists.txt +++ b/host/utils/CMakeLists.txt @@ -149,6 +149,9 @@ IF(LINUX) COMPONENT utilities ) ENDIF(LINUX) +IF(NOT HAVE_PYTHON_MODULE_REQUESTS) + MESSAGE(WARNING "Module requests not found -- uhd_images_downloader.py will not work without it.") +ENDIF(NOT HAVE_PYTHON_MODULE_REQUESTS) IF(ENABLE_USRP2) SET(burners diff --git a/host/utils/uhd_usrp_probe.cpp b/host/utils/uhd_usrp_probe.cpp index 49e00d53a..5fc407bfa 100644 --- a/host/utils/uhd_usrp_probe.cpp +++ b/host/utils/uhd_usrp_probe.cpp @@ -228,6 +228,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ ("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") + ("vector", "when querying a string, interpret that as std::vector") ("init-only", "skip all queries, only initialize device") ; @@ -250,7 +251,16 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ property_tree::sptr tree = dev->get_tree(); if (vm.count("string")){ - std::cout << tree->access<std::string>(vm["string"].as<std::string>()).get() << std::endl; + if (vm.count("vector")) { + std::vector<std::string> str_vector = tree->access< std::vector<std::string> >(vm["string"].as<std::string>()).get(); + std::cout << "("; + BOOST_FOREACH(const std::string &str, str_vector) { + std::cout << str << ","; + } + std::cout << ")" << std::endl; + } else { + std::cout << tree->access<std::string>(vm["string"].as<std::string>()).get() << std::endl; + } return EXIT_SUCCESS; } |