From 4a6543bd481370ae924ca90c325d5cd5b2dfe692 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 23 Jul 2010 22:55:30 -0700 Subject: usrp2: added codec impl for codec properties to usrp2 --- host/utils/uhd_usrp_probe.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'host/utils') 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 #include #include +#include #include #include #include @@ -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::endl; + //ss << std::endl; + prop_names_t gain_names(codec[usrp::CODEC_PROP_GAIN_NAMES].as()); + 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()); + 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::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()){ 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(); } -- cgit v1.2.3