summaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-08-05 17:33:57 -0700
committerJosh Blum <josh@joshknows.com>2010-08-06 12:15:05 -0700
commit187fe9d3e7353021d89da38b687ee8729a060ccd (patch)
tree93a8a9a165a9f2ba14af2c0833cbe4e62c5e933c /host
parent5ec42578fa9f69e92ae935c16717957a6ea66324 (diff)
downloaduhd-187fe9d3e7353021d89da38b687ee8729a060ccd.tar.gz
uhd-187fe9d3e7353021d89da38b687ee8729a060ccd.tar.bz2
uhd-187fe9d3e7353021d89da38b687ee8729a060ccd.zip
usrp: tweaks to subdev spec printing
Diffstat (limited to 'host')
-rw-r--r--host/lib/usrp/mimo_usrp.cpp4
-rw-r--r--host/lib/usrp/simple_usrp.cpp7
-rw-r--r--host/lib/usrp/subdev_spec.cpp6
-rw-r--r--host/lib/usrp/usrp2/mboard_impl.cpp2
4 files changed, 12 insertions, 7 deletions
diff --git a/host/lib/usrp/mimo_usrp.cpp b/host/lib/usrp/mimo_usrp.cpp
index 767fc1d48..34dee42b8 100644
--- a/host/lib/usrp/mimo_usrp.cpp
+++ b/host/lib/usrp/mimo_usrp.cpp
@@ -152,7 +152,7 @@ public:
/*******************************************************************
* RX methods
******************************************************************/
- void set_rx_subdev_spec(size_t chan, const uhd::usrp::subdev_spec_t &spec){
+ void set_rx_subdev_spec(size_t chan, const subdev_spec_t &spec){
UHD_ASSERT_THROW(spec.size() <= 1);
_mboard(chan)[MBOARD_PROP_RX_SUBDEV_SPEC] = spec;
}
@@ -224,7 +224,7 @@ public:
/*******************************************************************
* TX methods
******************************************************************/
- void set_tx_subdev_spec(size_t chan, const uhd::usrp::subdev_spec_t &spec){
+ void set_tx_subdev_spec(size_t chan, const subdev_spec_t &spec){
UHD_ASSERT_THROW(spec.size() <= 1);
_mboard(chan)[MBOARD_PROP_TX_SUBDEV_SPEC] = spec;
}
diff --git a/host/lib/usrp/simple_usrp.cpp b/host/lib/usrp/simple_usrp.cpp
index e2a1126ca..ebba5e137 100644
--- a/host/lib/usrp/simple_usrp.cpp
+++ b/host/lib/usrp/simple_usrp.cpp
@@ -26,6 +26,7 @@
#include <boost/foreach.hpp>
#include <boost/format.hpp>
#include <stdexcept>
+#include <iostream>
using namespace uhd;
using namespace uhd::usrp;
@@ -101,8 +102,9 @@ public:
/*******************************************************************
* RX methods
******************************************************************/
- void set_rx_subdev_spec(const uhd::usrp::subdev_spec_t &spec){
+ void set_rx_subdev_spec(const subdev_spec_t &spec){
_mboard()[MBOARD_PROP_RX_SUBDEV_SPEC] = spec;
+ std::cout << "RX " << _mboard()[MBOARD_PROP_RX_SUBDEV_SPEC].as<subdev_spec_t>().to_pp_string() << std::endl;
}
void set_rx_rate(double rate){
@@ -164,8 +166,9 @@ public:
/*******************************************************************
* TX methods
******************************************************************/
- void set_tx_subdev_spec(const uhd::usrp::subdev_spec_t &spec){
+ void set_tx_subdev_spec(const subdev_spec_t &spec){
_mboard()[MBOARD_PROP_TX_SUBDEV_SPEC] = spec;
+ std::cout << "TX " << _mboard()[MBOARD_PROP_TX_SUBDEV_SPEC].as<subdev_spec_t>().to_pp_string() << std::endl;
}
void set_tx_rate(double rate){
diff --git a/host/lib/usrp/subdev_spec.cpp b/host/lib/usrp/subdev_spec.cpp
index cca5c36b8..0f00e2f74 100644
--- a/host/lib/usrp/subdev_spec.cpp
+++ b/host/lib/usrp/subdev_spec.cpp
@@ -56,9 +56,13 @@ std::string subdev_spec_t::to_pp_string(void) const{
size_t count = 0;
ss << "Subdevice Specification:" << std::endl;
BOOST_FOREACH(const subdev_spec_pair_t &pair, *this){
+ std::string db_name = pair.db_name;
+ if (db_name == "") db_name = "0";
+ std::string sd_name = pair.sd_name;
+ if (sd_name == "") sd_name = "0";
ss << boost::format(
" Channel %d: Daughterboard %s, Subdevice %s"
- ) % (count++) % pair.db_name % pair.sd_name << std::endl;
+ ) % (count++) % db_name % sd_name << std::endl;
}
return ss.str();
}
diff --git a/host/lib/usrp/usrp2/mboard_impl.cpp b/host/lib/usrp/usrp2/mboard_impl.cpp
index a2a63edf3..92a87150a 100644
--- a/host/lib/usrp/usrp2/mboard_impl.cpp
+++ b/host/lib/usrp/usrp2/mboard_impl.cpp
@@ -325,7 +325,6 @@ void usrp2_mboard_impl::set(const wax::obj &key, const wax::obj &val){
if (_rx_subdev_spec.empty()) _rx_subdev_spec.push_back(
subdev_spec_pair_t("", _dboard_manager->get_rx_subdev_names().front())
);
- std::cout << "RX " << _rx_subdev_spec.to_pp_string() << std::endl;
//sanity check
UHD_ASSERT_THROW(_rx_subdev_spec.size() == 1);
uhd::assert_has((*this)[MBOARD_PROP_RX_DBOARD_NAMES].as<prop_names_t>(), _rx_subdev_spec.front().db_name, "rx dboard names");
@@ -342,7 +341,6 @@ void usrp2_mboard_impl::set(const wax::obj &key, const wax::obj &val){
if (_tx_subdev_spec.empty()) _tx_subdev_spec.push_back(
subdev_spec_pair_t("", _dboard_manager->get_tx_subdev_names().front())
);
- std::cout << "TX " << _tx_subdev_spec.to_pp_string() << std::endl;
//sanity check
UHD_ASSERT_THROW(_tx_subdev_spec.size() == 1);
uhd::assert_has((*this)[MBOARD_PROP_TX_DBOARD_NAMES].as<prop_names_t>(), _tx_subdev_spec.front().db_name, "tx dboard names");