aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-08-15 10:51:25 -0700
committerJosh Blum <josh@joshknows.com>2010-08-15 10:51:25 -0700
commit98ba0cc067489d417342314a7e7408d2dbbc8250 (patch)
tree7fdcaf08c5bbf150bd03711c9909ed5ca77f1818 /host/lib/usrp/usrp2
parent6c3d37caa3a47ca534c5e3a110adad0137d5d06d (diff)
downloaduhd-98ba0cc067489d417342314a7e7408d2dbbc8250.tar.gz
uhd-98ba0cc067489d417342314a7e7408d2dbbc8250.tar.bz2
uhd-98ba0cc067489d417342314a7e7408d2dbbc8250.zip
uhd: extract named prop returns a named prop (not a tuple)
simplifies the code after the property set/get declaration
Diffstat (limited to 'host/lib/usrp/usrp2')
-rw-r--r--host/lib/usrp/usrp2/codec_impl.cpp8
-rw-r--r--host/lib/usrp/usrp2/dboard_impl.cpp14
-rw-r--r--host/lib/usrp/usrp2/mboard_impl.cpp13
-rw-r--r--host/lib/usrp/usrp2/usrp2_impl.cpp5
4 files changed, 16 insertions, 24 deletions
diff --git a/host/lib/usrp/usrp2/codec_impl.cpp b/host/lib/usrp/usrp2/codec_impl.cpp
index b9d51abf5..fc917b102 100644
--- a/host/lib/usrp/usrp2/codec_impl.cpp
+++ b/host/lib/usrp/usrp2/codec_impl.cpp
@@ -40,9 +40,7 @@ void usrp2_mboard_impl::codec_init(void){
/***********************************************************************
* RX Codec Properties
**********************************************************************/
-void usrp2_mboard_impl::rx_codec_get(const wax::obj &key_, wax::obj &val){
- wax::obj key; std::string name;
- boost::tie(key, name) = extract_named_prop(key_);
+void usrp2_mboard_impl::rx_codec_get(const wax::obj &key, wax::obj &val){
//handle the get request conditioned on the key
switch(key.as<codec_prop_t>()){
@@ -69,9 +67,7 @@ void usrp2_mboard_impl::rx_codec_set(const wax::obj &, const wax::obj &){
/***********************************************************************
* TX Codec Properties
**********************************************************************/
-void usrp2_mboard_impl::tx_codec_get(const wax::obj &key_, wax::obj &val){
- wax::obj key; std::string name;
- boost::tie(key, name) = extract_named_prop(key_);
+void usrp2_mboard_impl::tx_codec_get(const wax::obj &key, wax::obj &val){
//handle the get request conditioned on the key
switch(key.as<codec_prop_t>()){
diff --git a/host/lib/usrp/usrp2/dboard_impl.cpp b/host/lib/usrp/usrp2/dboard_impl.cpp
index 075f22388..bafeb3f15 100644
--- a/host/lib/usrp/usrp2/dboard_impl.cpp
+++ b/host/lib/usrp/usrp2/dboard_impl.cpp
@@ -59,8 +59,7 @@ void usrp2_mboard_impl::dboard_init(void){
* RX DBoard Properties
**********************************************************************/
void usrp2_mboard_impl::rx_dboard_get(const wax::obj &key_, wax::obj &val){
- wax::obj key; std::string name;
- boost::tie(key, name) = extract_named_prop(key_);
+ named_prop_t key = named_prop_t::extract(key_);
//handle the get request conditioned on the key
switch(key.as<dboard_prop_t>()){
@@ -69,7 +68,7 @@ void usrp2_mboard_impl::rx_dboard_get(const wax::obj &key_, wax::obj &val){
return;
case DBOARD_PROP_SUBDEV:
- val = _dboard_manager->get_rx_subdev(name);
+ val = _dboard_manager->get_rx_subdev(key.name);
return;
case DBOARD_PROP_SUBDEV_NAMES:
@@ -90,7 +89,7 @@ void usrp2_mboard_impl::rx_dboard_get(const wax::obj &key_, wax::obj &val){
case DBOARD_PROP_GAIN_GROUP:
val = make_gain_group(
- _dboard_manager->get_rx_subdev(name), _rx_codec_proxy->get_link()
+ _dboard_manager->get_rx_subdev(key.name), _rx_codec_proxy->get_link()
);
return;
@@ -114,8 +113,7 @@ void usrp2_mboard_impl::rx_dboard_set(const wax::obj &key, const wax::obj &val){
* TX DBoard Properties
**********************************************************************/
void usrp2_mboard_impl::tx_dboard_get(const wax::obj &key_, wax::obj &val){
- wax::obj key; std::string name;
- boost::tie(key, name) = extract_named_prop(key_);
+ named_prop_t key = named_prop_t::extract(key_);
//handle the get request conditioned on the key
switch(key.as<dboard_prop_t>()){
@@ -124,7 +122,7 @@ void usrp2_mboard_impl::tx_dboard_get(const wax::obj &key_, wax::obj &val){
return;
case DBOARD_PROP_SUBDEV:
- val = _dboard_manager->get_tx_subdev(name);
+ val = _dboard_manager->get_tx_subdev(key.name);
return;
case DBOARD_PROP_SUBDEV_NAMES:
@@ -145,7 +143,7 @@ void usrp2_mboard_impl::tx_dboard_get(const wax::obj &key_, wax::obj &val){
case DBOARD_PROP_GAIN_GROUP:
val = make_gain_group(
- _dboard_manager->get_tx_subdev(name), _tx_codec_proxy->get_link()
+ _dboard_manager->get_tx_subdev(key.name), _tx_codec_proxy->get_link()
);
return;
diff --git a/host/lib/usrp/usrp2/mboard_impl.cpp b/host/lib/usrp/usrp2/mboard_impl.cpp
index 533b60bae..d354a943b 100644
--- a/host/lib/usrp/usrp2/mboard_impl.cpp
+++ b/host/lib/usrp/usrp2/mboard_impl.cpp
@@ -189,11 +189,10 @@ void usrp2_mboard_impl::issue_ddc_stream_cmd(const stream_cmd_t &stream_cmd){
static const std::string dboard_name = "0";
void usrp2_mboard_impl::get(const wax::obj &key_, wax::obj &val){
- wax::obj key; std::string name;
- boost::tie(key, name) = extract_named_prop(key_);
+ named_prop_t key = named_prop_t::extract(key_);
//handle the other props
- if (key.type() == typeid(std::string)){
+ if (key_.type() == typeid(std::string)){
if (key.as<std::string>() == "mac-addr"){
byte_vector_t bytes = _iface->read_eeprom(USRP2_I2C_ADDR_MBOARD, USRP2_EE_MBOARD_MAC_ADDR, 6);
val = mac_addr_t::from_bytes(bytes).to_string();
@@ -224,7 +223,7 @@ void usrp2_mboard_impl::get(const wax::obj &key_, wax::obj &val){
return;
case MBOARD_PROP_RX_DBOARD:
- UHD_ASSERT_THROW(name == dboard_name);
+ UHD_ASSERT_THROW(key.name == dboard_name);
val = _rx_dboard_proxy->get_link();
return;
@@ -233,7 +232,7 @@ void usrp2_mboard_impl::get(const wax::obj &key_, wax::obj &val){
return;
case MBOARD_PROP_TX_DBOARD:
- UHD_ASSERT_THROW(name == dboard_name);
+ UHD_ASSERT_THROW(key.name == dboard_name);
val = _tx_dboard_proxy->get_link();
return;
@@ -242,7 +241,7 @@ void usrp2_mboard_impl::get(const wax::obj &key_, wax::obj &val){
return;
case MBOARD_PROP_RX_DSP:
- UHD_ASSERT_THROW(name == "");
+ UHD_ASSERT_THROW(key.name == "");
val = _rx_dsp_proxy->get_link();
return;
@@ -251,7 +250,7 @@ void usrp2_mboard_impl::get(const wax::obj &key_, wax::obj &val){
return;
case MBOARD_PROP_TX_DSP:
- UHD_ASSERT_THROW(name == "");
+ UHD_ASSERT_THROW(key.name == "");
val = _tx_dsp_proxy->get_link();
return;
diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp
index 45362c20f..568c87a22 100644
--- a/host/lib/usrp/usrp2/usrp2_impl.cpp
+++ b/host/lib/usrp/usrp2/usrp2_impl.cpp
@@ -201,8 +201,7 @@ usrp2_impl::~usrp2_impl(void){
* Device Properties
**********************************************************************/
void usrp2_impl::get(const wax::obj &key_, wax::obj &val){
- wax::obj key; std::string name;
- boost::tie(key, name) = extract_named_prop(key_);
+ named_prop_t key = named_prop_t::extract(key_);
//handle the get request conditioned on the key
switch(key.as<device_prop_t>()){
@@ -212,7 +211,7 @@ void usrp2_impl::get(const wax::obj &key_, wax::obj &val){
return;
case DEVICE_PROP_MBOARD:
- val = _mboard_dict[name]->get_link();
+ val = _mboard_dict[key.name]->get_link();
return;
case DEVICE_PROP_MBOARD_NAMES: