From 73d42182be1b84943dfa0569d3cb2d0a5b21e2ff Mon Sep 17 00:00:00 2001 From: Marcus Müller Date: Thu, 16 Apr 2015 21:37:49 +0200 Subject: utils: added integer, range and double property tree accessors This amends uhd_usrp_probe's ability to query the property tree. --- host/utils/uhd_usrp_probe.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'host/utils') diff --git a/host/utils/uhd_usrp_probe.cpp b/host/utils/uhd_usrp_probe.cpp index a03646cc0..f8a8b5665 100644 --- a/host/utils/uhd_usrp_probe.cpp +++ b/host/utils/uhd_usrp_probe.cpp @@ -192,7 +192,10 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ ("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") + ("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") + ("range", po::value(), "query a range (gain, bandwidth, frequency, ...) from the property tree") ("init-only", "skip all queries, only initialize device") ; @@ -219,6 +222,22 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ return EXIT_SUCCESS; } + if (vm.count("double")){ + std::cout << tree->access(vm["double"].as()).get() << std::endl; + return EXIT_SUCCESS; + } + + if (vm.count("int")){ + std::cout << tree->access(vm["int"].as()).get() << 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; + return EXIT_SUCCESS; + } + if (vm.count("tree") != 0) print_tree("/", tree); else if (not vm.count("init-only")) std::cout << make_border(get_device_pp_string(tree)) << std::endl; -- cgit v1.2.3 From 396549ac210df6cebc662213d812a8ce4353f467 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Mon, 20 Apr 2015 15:50:48 -0700 Subject: cmake: Improve usage of C modules --- host/CMakeLists.txt | 2 +- host/utils/CMakeLists.txt | 2 -- host/utils/usrp_x3xx_fpga_burner.cpp | 4 ---- 3 files changed, 1 insertion(+), 7 deletions(-) (limited to 'host/utils') diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt index 8dddb6552..1fa8b2cdb 100644 --- a/host/CMakeLists.txt +++ b/host/CMakeLists.txt @@ -24,7 +24,7 @@ # Project setup ######################################################################## CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -PROJECT(UHD CXX) +PROJECT(UHD CXX C) ENABLE_TESTING() #make sure our local CMake Modules path comes first diff --git a/host/utils/CMakeLists.txt b/host/utils/CMakeLists.txt index ed8640187..e24b417c1 100644 --- a/host/utils/CMakeLists.txt +++ b/host/utils/CMakeLists.txt @@ -15,8 +15,6 @@ # along with this program. If not, see . # -SET(CMAKE_C_COMPILE_OBJECT ${CMAKE_CXX_COMPILE_OBJECT}) - ######################################################################## # Utilities that get installed into the runtime path ######################################################################## diff --git a/host/utils/usrp_x3xx_fpga_burner.cpp b/host/utils/usrp_x3xx_fpga_burner.cpp index e32e4d636..3c6225531 100644 --- a/host/utils/usrp_x3xx_fpga_burner.cpp +++ b/host/utils/usrp_x3xx_fpga_burner.cpp @@ -49,13 +49,9 @@ #include #include -#ifdef _MSC_VER extern "C" { -#endif #include "cdecode.h" -#ifdef _MSC_VER } -#endif #define X300_FPGA_BIN_SIZE_BYTES 15877916 #define X300_FPGA_BIT_MAX_SIZE_BYTES 15878022 -- cgit v1.2.3