aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard_base.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-05-03 01:20:11 -0700
committerJosh Blum <josh@joshknows.com>2010-05-03 01:20:11 -0700
commit4d5df2376b204afb724684d0d864ce0d93fe83fb (patch)
treec0552615c8f51eb89c3214c8fed7105387264cae /host/lib/usrp/dboard_base.cpp
parentfd0d9b7dcca13b4d8a4e1912682f58eb6b6ab634 (diff)
downloaduhd-4d5df2376b204afb724684d0d864ce0d93fe83fb.tar.gz
uhd-4d5df2376b204afb724684d0d864ce0d93fe83fb.tar.bz2
uhd-4d5df2376b204afb724684d0d864ce0d93fe83fb.zip
Expanded the dboard id API to create dboard id types from strings and ints.
And created utility functions to go between representations. Created to_pp_string for pretty print strings for dboard ids and device addrs. Minor changes to the various classes that call these utilities.
Diffstat (limited to 'host/lib/usrp/dboard_base.cpp')
-rw-r--r--host/lib/usrp/dboard_base.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/host/lib/usrp/dboard_base.cpp b/host/lib/usrp/dboard_base.cpp
index 523da696a..bd4b37ef3 100644
--- a/host/lib/usrp/dboard_base.cpp
+++ b/host/lib/usrp/dboard_base.cpp
@@ -58,15 +58,15 @@ dboard_id_t dboard_base::get_tx_id(void){
* xcvr dboard dboard_base class
**********************************************************************/
xcvr_dboard_base::xcvr_dboard_base(ctor_args_t args) : dboard_base(args){
- if (get_rx_id() == dboard_id::NONE){
+ if (get_rx_id() == dboard_id_t::none()){
throw std::runtime_error(str(boost::format(
"cannot create xcvr board when the rx id is \"%s\""
- ) % dboard_id::to_string(dboard_id::NONE)));
+ ) % dboard_id_t::none().to_pp_string()));
}
- if (get_tx_id() == dboard_id::NONE){
+ if (get_tx_id() == dboard_id_t::none()){
throw std::runtime_error(str(boost::format(
"cannot create xcvr board when the tx id is \"%s\""
- ) % dboard_id::to_string(dboard_id::NONE)));
+ ) % dboard_id_t::none().to_pp_string()));
}
}
@@ -78,11 +78,11 @@ xcvr_dboard_base::~xcvr_dboard_base(void){
* rx dboard dboard_base class
**********************************************************************/
rx_dboard_base::rx_dboard_base(ctor_args_t args) : dboard_base(args){
- if (get_tx_id() != dboard_id::NONE){
+ if (get_tx_id() != dboard_id_t::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(dboard_id::NONE)));
+ ) % get_tx_id().to_pp_string() % dboard_id_t::none().to_pp_string()));
}
}
@@ -102,11 +102,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 args) : dboard_base(args){
- if (get_rx_id() != dboard_id::NONE){
+ if (get_rx_id() != dboard_id_t::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(dboard_id::NONE)));
+ ) % get_rx_id().to_pp_string() % dboard_id_t::none().to_pp_string()));
}
}