diff options
author | Josh Blum <josh@joshknows.com> | 2010-07-23 22:55:30 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-07-27 15:45:49 -0700 |
commit | c2b97490b7920f67d7522a1640b9c53b014a5349 (patch) | |
tree | de9deef0506d243ecc1209c4bf74645cfeaa81f2 /host/utils | |
parent | 3b056a00425c8c1cc907a14983611268efb86878 (diff) | |
download | uhd-c2b97490b7920f67d7522a1640b9c53b014a5349.tar.gz uhd-c2b97490b7920f67d7522a1640b9c53b014a5349.tar.bz2 uhd-c2b97490b7920f67d7522a1640b9c53b014a5349.zip |
usrp2: added codec impl for codec properties to usrp2
Diffstat (limited to 'host/utils')
-rw-r--r-- | host/utils/uhd_usrp_probe.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/host/utils/uhd_usrp_probe.cpp b/host/utils/uhd_usrp_probe.cpp index 1b73b5788..9587ea9a3 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> @@ -94,6 +95,19 @@ static std::string get_subdev_pp_string(const std::string &type, wax::obj subdev 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(); } |