aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-03-22 17:41:49 -0700
committerJosh Blum <josh@joshknows.com>2010-03-22 17:41:49 -0700
commit767bb419200aa80f90a8845e92c989215919f3a7 (patch)
tree41985c38b9d4761aa2eb525ef7ddd54a8fe6ea67 /host
parentd66efda608db9f6a1c2ab64659556b53810d87b7 (diff)
downloaduhd-767bb419200aa80f90a8845e92c989215919f3a7.tar.gz
uhd-767bb419200aa80f90a8845e92c989215919f3a7.tar.bz2
uhd-767bb419200aa80f90a8845e92c989215919f3a7.zip
massaged some of the dboard calls
Diffstat (limited to 'host')
-rw-r--r--host/include/uhd/usrp/dboard_id.hpp3
-rw-r--r--host/include/uhd/usrp/dboard_manager.hpp4
-rw-r--r--host/lib/usrp/dboard/basic.cpp4
-rw-r--r--host/lib/usrp/dboard_base.cpp16
-rw-r--r--host/lib/usrp/dboard_manager.cpp8
5 files changed, 17 insertions, 18 deletions
diff --git a/host/include/uhd/usrp/dboard_id.hpp b/host/include/uhd/usrp/dboard_id.hpp
index cdd6a4395..afacaf8ff 100644
--- a/host/include/uhd/usrp/dboard_id.hpp
+++ b/host/include/uhd/usrp/dboard_id.hpp
@@ -26,9 +26,8 @@ namespace uhd{ namespace usrp{
typedef boost::uint16_t dboard_id_t;
-static const dboard_id_t ID_NONE = 0xffff;
-
namespace dboard_id{
+ static const dboard_id_t NONE = 0xffff;
UHD_API std::string to_string(const dboard_id_t &id);
}
diff --git a/host/include/uhd/usrp/dboard_manager.hpp b/host/include/uhd/usrp/dboard_manager.hpp
index 6a105d1de..c7c091220 100644
--- a/host/include/uhd/usrp/dboard_manager.hpp
+++ b/host/include/uhd/usrp/dboard_manager.hpp
@@ -42,7 +42,7 @@ public:
/*!
* Register a dboard into the system.
- *
+ * For single subdevice boards, omit subdev_names.
* \param dboard_id the dboard id (rx or tx)
* \param dboard_ctor the dboard constructor function pointer
* \param name the canonical name for the dboard represented
@@ -52,7 +52,7 @@ public:
dboard_id_t dboard_id,
dboard_ctor_t dboard_ctor,
const std::string &name,
- const prop_names_t &subdev_names
+ const prop_names_t &subdev_names = prop_names_t(1, "")
);
/*!
diff --git a/host/lib/usrp/dboard/basic.cpp b/host/lib/usrp/dboard/basic.cpp
index 82485ae6a..849cbd764 100644
--- a/host/lib/usrp/dboard/basic.cpp
+++ b/host/lib/usrp/dboard/basic.cpp
@@ -75,9 +75,9 @@ static dboard_base::sptr make_lf_tx(dboard_base::ctor_args_t const& args){
}
STATIC_BLOCK(reg_dboards){
- dboard_manager::register_dboard(0x0000, &make_basic_tx, "Basic TX", list_of(""));
+ dboard_manager::register_dboard(0x0000, &make_basic_tx, "Basic TX");
dboard_manager::register_dboard(0x0001, &make_basic_rx, "Basic RX", list_of("ab")("a")("b"));
- dboard_manager::register_dboard(0x000e, &make_lf_tx, "LF TX", list_of(""));
+ dboard_manager::register_dboard(0x000e, &make_lf_tx, "LF TX");
dboard_manager::register_dboard(0x000f, &make_lf_rx, "LF RX", list_of("ab")("a")("b"));
}
diff --git a/host/lib/usrp/dboard_base.cpp b/host/lib/usrp/dboard_base.cpp
index 6dd41cfd8..09d3bbfd4 100644
--- a/host/lib/usrp/dboard_base.cpp
+++ b/host/lib/usrp/dboard_base.cpp
@@ -52,15 +52,15 @@ dboard_id_t dboard_base::get_tx_id(void){
* xcvr dboard dboard_base class
**********************************************************************/
xcvr_dboard_base::xcvr_dboard_base(ctor_args_t const& args) : dboard_base(args){
- if (get_rx_id() == ID_NONE){
+ if (get_rx_id() == dboard_id::NONE){
throw std::runtime_error(str(boost::format(
"cannot create xcvr board when the rx id is \"%s\""
- ) % dboard_id::to_string(ID_NONE)));
+ ) % dboard_id::to_string(dboard_id::NONE)));
}
- if (get_tx_id() == ID_NONE){
+ if (get_tx_id() == dboard_id::NONE){
throw std::runtime_error(str(boost::format(
"cannot create xcvr board when the tx id is \"%s\""
- ) % dboard_id::to_string(ID_NONE)));
+ ) % dboard_id::to_string(dboard_id::NONE)));
}
}
@@ -72,11 +72,11 @@ xcvr_dboard_base::~xcvr_dboard_base(void){
* rx dboard dboard_base class
**********************************************************************/
rx_dboard_base::rx_dboard_base(ctor_args_t const& args) : dboard_base(args){
- if (get_tx_id() != ID_NONE){
+ if (get_tx_id() != dboard_id::NONE){
throw std::runtime_error(str(boost::format(
"cannot create rx board when the tx id is \"%s\""
" -> expected a tx id of \"%s\""
- ) % dboard_id::to_string(get_tx_id()) % dboard_id::to_string(ID_NONE)));
+ ) % dboard_id::to_string(get_tx_id()) % dboard_id::to_string(dboard_id::NONE)));
}
}
@@ -96,11 +96,11 @@ void rx_dboard_base::tx_set(const wax::obj &, const wax::obj &){
* tx dboard dboard_base class
**********************************************************************/
tx_dboard_base::tx_dboard_base(ctor_args_t const& args) : dboard_base(args){
- if (get_rx_id() != ID_NONE){
+ if (get_rx_id() != dboard_id::NONE){
throw std::runtime_error(str(boost::format(
"cannot create tx board when the rx id is \"%s\""
" -> expected a rx id of \"%s\""
- ) % dboard_id::to_string(get_rx_id()) % dboard_id::to_string(ID_NONE)));
+ ) % dboard_id::to_string(get_rx_id()) % dboard_id::to_string(dboard_id::NONE)));
}
}
diff --git a/host/lib/usrp/dboard_manager.cpp b/host/lib/usrp/dboard_manager.cpp
index 6ca15e98c..6683534f1 100644
--- a/host/lib/usrp/dboard_manager.cpp
+++ b/host/lib/usrp/dboard_manager.cpp
@@ -163,12 +163,12 @@ static args_t get_dboard_args(
std::string const& xx_type
){
//special case, its rx and the none id (0xffff)
- if (xx_type == "rx" and dboard_id == ID_NONE){
+ if (xx_type == "rx" and dboard_id == dboard_id::NONE){
return get_dboard_args(0x0001, xx_type);
}
//special case, its tx and the none id (0xffff)
- if (xx_type == "tx" and dboard_id == ID_NONE){
+ if (xx_type == "tx" and dboard_id == dboard_id::NONE){
return get_dboard_args(0x0000, xx_type);
}
@@ -223,7 +223,7 @@ dboard_manager_impl::dboard_manager_impl(
//make the rx subdevs
BOOST_FOREACH(std::string subdev, rx_subdevs){
dboard_base::sptr rx_dboard = rx_dboard_ctor(
- dboard_base::ctor_args_t(subdev, interface, rx_dboard_id, ID_NONE)
+ dboard_base::ctor_args_t(subdev, interface, rx_dboard_id, dboard_id::NONE)
);
//create a rx proxy for this rx board
_rx_dboards[subdev] = subdev_proxy::sptr(
@@ -233,7 +233,7 @@ dboard_manager_impl::dboard_manager_impl(
//make the tx subdevs
BOOST_FOREACH(std::string subdev, tx_subdevs){
dboard_base::sptr tx_dboard = tx_dboard_ctor(
- dboard_base::ctor_args_t(subdev, interface, ID_NONE, tx_dboard_id)
+ dboard_base::ctor_args_t(subdev, interface, dboard_id::NONE, tx_dboard_id)
);
//create a tx proxy for this tx board
_tx_dboards[subdev] = subdev_proxy::sptr(