diff options
author | Nick Foster <nick@nerdnetworks.org> | 2010-07-27 16:53:05 -0700 |
---|---|---|
committer | Nick Foster <nick@nerdnetworks.org> | 2010-07-27 16:53:05 -0700 |
commit | 92e7a28de3f022f52da3fb9232a8287f6fa07d46 (patch) | |
tree | 02c37b732049e50872bd18b764dcfb8041e341e1 /host/utils/uhd_usrp_probe.cpp | |
parent | aeedd5a53e017e2c14a86dff521353ff6016a849 (diff) | |
download | uhd-92e7a28de3f022f52da3fb9232a8287f6fa07d46.tar.gz uhd-92e7a28de3f022f52da3fb9232a8287f6fa07d46.tar.bz2 uhd-92e7a28de3f022f52da3fb9232a8287f6fa07d46.zip |
This is a manual merge of codec_gains2 into usrp2py.
Diffstat (limited to 'host/utils/uhd_usrp_probe.cpp')
-rw-r--r-- | host/utils/uhd_usrp_probe.cpp | 17 |
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(); } |