summaryrefslogtreecommitdiffstats
path: root/host/utils
diff options
context:
space:
mode:
authorNick Foster <nick@nerdnetworks.org>2010-07-26 17:48:19 -0700
committerNick Foster <nick@nerdnetworks.org>2010-07-26 17:48:19 -0700
commit5196d701384a9986ba6a166a02c6775e83f264f6 (patch)
tree5920ca6d127c53932a1b3f95a11ea47532edff7a /host/utils
parentd8f3980e45458cf68c8efaa029e492a1b8d08354 (diff)
parent6799b5bec4403cc4458181cb39fae2f960f2a7cd (diff)
downloaduhd-5196d701384a9986ba6a166a02c6775e83f264f6.tar.gz
uhd-5196d701384a9986ba6a166a02c6775e83f264f6.tar.bz2
uhd-5196d701384a9986ba6a166a02c6775e83f264f6.zip
Merge branch 'codec_gains' of git@ettus.sourcerepo.com:ettus/uhdpriv into usrp2p2
Diffstat (limited to 'host/utils')
-rw-r--r--host/utils/uhd_usrp_probe.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/host/utils/uhd_usrp_probe.cpp b/host/utils/uhd_usrp_probe.cpp
index 1b73b5788..097317516 100644
--- a/host/utils/uhd_usrp_probe.cpp
+++ b/host/utils/uhd_usrp_probe.cpp
@@ -21,6 +21,7 @@
#include <uhd/usrp/device_props.hpp>
#include <uhd/usrp/mboard_props.hpp>
#include <uhd/usrp/dboard_props.hpp>
+#include <uhd/usrp/codec_props.hpp>
#include <uhd/usrp/dsp_props.hpp>
#include <uhd/usrp/subdev_props.hpp>
#include <uhd/usrp/dboard_id.hpp>
@@ -88,12 +89,25 @@ static std::string get_subdev_pp_string(const std::string &type, wax::obj subdev
ss << boost::format("Gain range %s: %.1f to %.1f step %.1f dB") % gain_name % gain_range.min % gain_range.max % gain_range.step << std::endl;
}
- ss << boost::format("Connection Type: %c") % (subdev[usrp::SUBDEV_PROP_CONNECTION].as<usrp::subdev_conn_t>()) << std::endl;
+ ss << boost::format("Connection Type: %c") % char(subdev[usrp::SUBDEV_PROP_CONNECTION].as<usrp::subdev_conn_t>()) << std::endl;
ss << boost::format("Uses LO offset: %s") % (subdev[usrp::SUBDEV_PROP_USE_LO_OFFSET].as<bool>()? "Yes" : "No") << std::endl;
return ss.str();
}
+static std::string get_codec_pp_string(const std::string &type, wax::obj codec){
+ std::stringstream ss;
+ ss << boost::format("%s Codec: %s") % type % codec[usrp::CODEC_PROP_NAME].as<std::string>() << std::endl;
+ //ss << std::endl;
+ prop_names_t gain_names(codec[usrp::CODEC_PROP_GAIN_NAMES].as<prop_names_t>());
+ if (gain_names.size() == 0) ss << "Gain Elements: None" << std::endl;
+ BOOST_FOREACH(const std::string &gain_name, gain_names){
+ gain_range_t gain_range(codec[named_prop_t(usrp::CODEC_PROP_GAIN_RANGE, gain_name)].as<gain_range_t>());
+ ss << boost::format("Gain range %s: %.1f to %.1f step %.1f dB") % gain_name % gain_range.min % gain_range.max % gain_range.step << std::endl;
+ }
+ return ss.str();
+}
+
static std::string get_dboard_pp_string(const std::string &type, wax::obj dboard){
std::stringstream ss;
ss << boost::format("%s Dboard: %s") % type % dboard[usrp::DBOARD_PROP_NAME].as<std::string>() << std::endl;
@@ -101,6 +115,7 @@ static std::string get_dboard_pp_string(const std::string &type, wax::obj dboard
BOOST_FOREACH(const std::string &subdev_name, dboard[usrp::DBOARD_PROP_SUBDEV_NAMES].as<prop_names_t>()){
ss << make_border(get_subdev_pp_string(type, dboard[named_prop_t(usrp::DBOARD_PROP_SUBDEV, subdev_name)]));
}
+ ss << make_border(get_codec_pp_string(type, dboard[usrp::DBOARD_PROP_CODEC]));
return ss.str();
}