aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard/db_dbsrx.cpp
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/dboard/db_dbsrx.cpp
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/dboard/db_dbsrx.cpp')
-rw-r--r--host/lib/usrp/dboard/db_dbsrx.cpp29
1 files changed, 7 insertions, 22 deletions
diff --git a/host/lib/usrp/dboard/db_dbsrx.cpp b/host/lib/usrp/dboard/db_dbsrx.cpp
index 072497dcc..06cf91d3b 100644
--- a/host/lib/usrp/dboard/db_dbsrx.cpp
+++ b/host/lib/usrp/dboard/db_dbsrx.cpp
@@ -500,8 +500,7 @@ void dbsrx::set_bandwidth(float bandwidth){
* RX Get and Set
**********************************************************************/
void dbsrx::rx_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<subdev_prop_t>()){
@@ -514,13 +513,13 @@ void dbsrx::rx_get(const wax::obj &key_, wax::obj &val){
return;
case SUBDEV_PROP_GAIN:
- assert_has(_gains.keys(), name, "dbsrx gain name");
- val = _gains[name];
+ assert_has(_gains.keys(), key.name, "dbsrx gain name");
+ val = _gains[key.name];
return;
case SUBDEV_PROP_GAIN_RANGE:
- assert_has(dbsrx_gain_ranges.keys(), name, "dbsrx gain name");
- val = dbsrx_gain_ranges[name];
+ assert_has(dbsrx_gain_ranges.keys(), key.name, "dbsrx gain name");
+ val = dbsrx_gain_ranges[key.name];
return;
case SUBDEV_PROP_GAIN_NAMES:
@@ -543,19 +542,6 @@ void dbsrx::rx_get(const wax::obj &key_, wax::obj &val){
val = dbsrx_antennas;
return;
-/*
- case SUBDEV_PROP_QUADRATURE:
- val = true;
- return;
-
- case SUBDEV_PROP_IQ_SWAPPED:
- val = false;
- return;
-
- case SUBDEV_PROP_SPECTRUM_INVERTED:
- val = false;
- return;
-*/
case SUBDEV_PROP_CONNECTION:
val = SUBDEV_CONN_COMPLEX_IQ;
return;
@@ -583,8 +569,7 @@ void dbsrx::rx_get(const wax::obj &key_, wax::obj &val){
}
void dbsrx::rx_set(const wax::obj &key_, const 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<subdev_prop_t>()){
@@ -594,7 +579,7 @@ void dbsrx::rx_set(const wax::obj &key_, const wax::obj &val){
return;
case SUBDEV_PROP_GAIN:
- this->set_gain(val.as<float>(), name);
+ this->set_gain(val.as<float>(), key.name);
return;
case SUBDEV_PROP_BANDWIDTH: