aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/misc_utils.cpp
diff options
context:
space:
mode:
authorNick Foster <nick@nerdnetworks.org>2010-10-08 16:58:45 -0700
committerNick Foster <nick@nerdnetworks.org>2010-10-08 16:58:45 -0700
commit3df994e1c784d7037e869610f1417fe64e0e89a8 (patch)
tree03183a0bff1b128d70d90aee5f9e6c641b9cf999 /host/lib/usrp/misc_utils.cpp
parent4a6990c5d3019ca6881464f135a315e3ec022b93 (diff)
parent58e1ca09772408d5d18ee219146fe57d2045c496 (diff)
downloaduhd-3df994e1c784d7037e869610f1417fe64e0e89a8.tar.gz
uhd-3df994e1c784d7037e869610f1417fe64e0e89a8.tar.bz2
uhd-3df994e1c784d7037e869610f1417fe64e0e89a8.zip
Merge branch 'master' of ettus.sourcerepo.com:ettus/uhdpriv into usrp2p
Conflicts: host/lib/usrp/usrp2/io_impl.cpp host/lib/usrp/usrp2/mboard_impl.cpp
Diffstat (limited to 'host/lib/usrp/misc_utils.cpp')
-rw-r--r--host/lib/usrp/misc_utils.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/host/lib/usrp/misc_utils.cpp b/host/lib/usrp/misc_utils.cpp
index 5cfcdc8d3..05308baba 100644
--- a/host/lib/usrp/misc_utils.cpp
+++ b/host/lib/usrp/misc_utils.cpp
@@ -17,6 +17,7 @@
#include <uhd/usrp/misc_utils.hpp>
#include <uhd/utils/assert.hpp>
+#include <uhd/utils/algorithm.hpp>
#include <uhd/utils/gain_group.hpp>
#include <uhd/usrp/dboard_id.hpp>
#include <uhd/usrp/subdev_props.hpp>
@@ -186,6 +187,22 @@ static void verify_xx_subdev_spec(
"Validate %s subdev spec failed: %s\n %s"
) % xx_type % subdev_spec.to_string() % e.what()));
}
+
+ //now use the subdev spec to enable the subdevices in use and vice-versa
+ BOOST_FOREACH(const std::string &db_name, mboard[dboard_names_prop].as<prop_names_t>()){
+ wax::obj dboard = mboard[named_prop_t(dboard_prop, db_name)];
+ BOOST_FOREACH(const std::string &sd_name, dboard[DBOARD_PROP_SUBDEV_NAMES].as<prop_names_t>()){
+ try{
+ bool enable = std::has(subdev_spec, subdev_spec_pair_t(db_name, sd_name));
+ dboard[named_prop_t(DBOARD_PROP_SUBDEV, sd_name)][SUBDEV_PROP_ENABLED] = enable;
+ }
+ catch(const std::exception &e){
+ throw std::runtime_error(str(boost::format(
+ "Cannot set enabled property on subdevice %s:%s\n %s"
+ ) % db_name % sd_name % e.what()));
+ }
+ }
+ }
}
void usrp::verify_rx_subdev_spec(subdev_spec_t &subdev_spec, wax::obj mboard){