diff options
author | Josh Blum <josh@joshknows.com> | 2010-08-30 16:54:18 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-08-30 16:54:18 -0700 |
commit | f5c62a46cbc44e254c0214b463d51f06675c17ab (patch) | |
tree | 54625123fad727091e0061eab6017dc98336f1d6 /host/lib/usrp | |
parent | 051b611bc304b099541706fe41f47ad5e75b7448 (diff) | |
download | uhd-f5c62a46cbc44e254c0214b463d51f06675c17ab.tar.gz uhd-f5c62a46cbc44e254c0214b463d51f06675c17ab.tar.bz2 uhd-f5c62a46cbc44e254c0214b463d51f06675c17ab.zip |
usrp1: subdev spec tweaks and docs
Diffstat (limited to 'host/lib/usrp')
-rw-r--r-- | host/lib/usrp/misc_utils.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/host/lib/usrp/misc_utils.cpp b/host/lib/usrp/misc_utils.cpp index a1664d810..5cfcdc8d3 100644 --- a/host/lib/usrp/misc_utils.cpp +++ b/host/lib/usrp/misc_utils.cpp @@ -164,13 +164,22 @@ static void verify_xx_subdev_spec( //empty db name means select dboard automatically if (pair.db_name.empty()){ if (dboard_names.size() != 1) throw std::runtime_error( - "A daughterboard name must be provided for multi-slot boards: " + subdev_spec.to_string() + "A daughterboard name must be provided for multi-slot motherboards: " + subdev_spec.to_string() ); pair.db_name == dboard_names.front(); } uhd::assert_has(dboard_names, pair.db_name, xx_type + " dboard name"); wax::obj dboard = mboard[named_prop_t(dboard_prop, pair.db_name)]; - uhd::assert_has(dboard[DBOARD_PROP_SUBDEV_NAMES].as<prop_names_t>(), pair.sd_name, xx_type + " subdev name"); + prop_names_t subdev_names = dboard[DBOARD_PROP_SUBDEV_NAMES].as<prop_names_t>(); + + //empty sd name means select the subdev automatically + if (pair.sd_name.empty()){ + if (subdev_names.size() != 1) throw std::runtime_error( + "A subdevice name must be provided for multi-subdev daughterboards: " + subdev_spec.to_string() + ); + pair.sd_name == subdev_names.front(); + } + uhd::assert_has(subdev_names, pair.sd_name, xx_type + " subdev name"); } }catch(const std::exception &e){ throw std::runtime_error(str(boost::format( |