aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp2
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-06-28 19:10:55 -0700
committerJosh Blum <josh@joshknows.com>2011-06-28 19:10:55 -0700
commitebd2ecc6ff2b82cb06701bbcda17d4caaa4ba8c1 (patch)
tree458881f9c6fda810b0dc51a5ee12b89c24624b82 /host/lib/usrp2
parentcbbae2f5b4a429458892267254bdf6e25864f375 (diff)
downloaduhd-ebd2ecc6ff2b82cb06701bbcda17d4caaa4ba8c1.tar.gz
uhd-ebd2ecc6ff2b82cb06701bbcda17d4caaa4ba8c1.tar.bz2
uhd-ebd2ecc6ff2b82cb06701bbcda17d4caaa4ba8c1.zip
uhd: work getting multi-usrp working
Diffstat (limited to 'host/lib/usrp2')
-rw-r--r--host/lib/usrp2/io_impl.cpp19
-rw-r--r--host/lib/usrp2/usrp2_impl.cpp4
2 files changed, 5 insertions, 18 deletions
diff --git a/host/lib/usrp2/io_impl.cpp b/host/lib/usrp2/io_impl.cpp
index fde02577c..a8ca0cd3a 100644
--- a/host/lib/usrp2/io_impl.cpp
+++ b/host/lib/usrp2/io_impl.cpp
@@ -302,18 +302,12 @@ void usrp2_impl::update_tx_samp_rate(const double rate){
_io_impl->send_handler.set_samp_rate(rate);
}
-void usrp2_impl::update_rx_subdev_spec(const std::string &which_mb, const subdev_spec_t &spec_){
+void usrp2_impl::update_rx_subdev_spec(const std::string &which_mb, const subdev_spec_t &spec){
boost::mutex::scoped_lock recv_lock = _io_impl->recv_handler.get_scoped_lock();
property_tree::path_type root = "/mboards/" + which_mb + "/dboards";
//sanity checking
- subdev_spec_t spec(spec_);
- if (spec.size() == 0){
- //determine the first subdev spec that exists
- const std::string db_name = _tree->list(root).at(0);
- const std::string sd_name = _tree->list(root / db_name / "rx_frontends").at(0);
- spec.push_back(subdev_spec_pair_t(db_name, sd_name));
- }
+ if (spec.size() == 0) throw uhd::value_error("rx subdev spec cant be empty");
if (spec.size() > _mbc[which_mb].rx_dsps.size()) throw uhd::value_error("rx subdev spec too long");
//setup mux for this spec
@@ -341,18 +335,11 @@ void usrp2_impl::update_rx_subdev_spec(const std::string &which_mb, const subdev
}
}
-void usrp2_impl::update_tx_subdev_spec(const std::string &which_mb, const subdev_spec_t &spec_){
+void usrp2_impl::update_tx_subdev_spec(const std::string &which_mb, const subdev_spec_t &spec){
boost::mutex::scoped_lock send_lock = _io_impl->send_handler.get_scoped_lock();
property_tree::path_type root = "/mboards/" + which_mb + "/dboards";
//sanity checking
- subdev_spec_t spec(spec_);
- if (spec.size() == 0){
- //determine the first subdev spec that exists
- const std::string db_name = _tree->list(root).at(0);
- const std::string sd_name = _tree->list(root / db_name / "tx_frontends").at(0);
- spec.push_back(subdev_spec_pair_t(db_name, sd_name));
- }
if (spec.size() != 1) throw uhd::value_error("tx subdev spec has to be size 1");
//set the mux for this spec
diff --git a/host/lib/usrp2/usrp2_impl.cpp b/host/lib/usrp2/usrp2_impl.cpp
index 829becd19..50d1eb2e2 100644
--- a/host/lib/usrp2/usrp2_impl.cpp
+++ b/host/lib/usrp2/usrp2_impl.cpp
@@ -544,8 +544,8 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr){
BOOST_FOREACH(const std::string &mb, _mbc.keys()){
property_tree::path_type root = "/mboards/" + mb;
_tree->access<double>(root / "tick_rate").update();
- _tree->access<subdev_spec_t>(root / "rx_subdev_spec").set(subdev_spec_t());
- _tree->access<subdev_spec_t>(root / "tx_subdev_spec").set(subdev_spec_t());
+ _tree->access<subdev_spec_t>(root / "rx_subdev_spec").set(subdev_spec_t("A:"+_mbc[mb].dboard_manager->get_rx_subdev_names()[0]));
+ _tree->access<subdev_spec_t>(root / "tx_subdev_spec").set(subdev_spec_t("A:"+_mbc[mb].dboard_manager->get_tx_subdev_names()[0]));
_tree->access<std::string>(root / "ref_source/value").set("internal");
_tree->access<std::string>(root / "time_source/value").set("none");