aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/simple_usrp.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-08-06 15:18:02 -0700
committerJosh Blum <josh@joshknows.com>2010-08-06 15:18:02 -0700
commit03ccbeb6411c0c13adf54bde4c19372ffa141aa0 (patch)
treeb3b1c1b801495775db74b0c66f273166131b68a0 /host/lib/usrp/simple_usrp.cpp
parent5fe5ff0655a410aac686d130daf9a77e39fd01b5 (diff)
parentd1711722dd432ba63b54f93d92270d4050465204 (diff)
downloaduhd-03ccbeb6411c0c13adf54bde4c19372ffa141aa0.tar.gz
uhd-03ccbeb6411c0c13adf54bde4c19372ffa141aa0.tar.bz2
uhd-03ccbeb6411c0c13adf54bde4c19372ffa141aa0.zip
Merge branch 'codec_gains'
Conflicts: host/lib/usrp/mimo_usrp.cpp host/lib/usrp/simple_usrp.cpp host/test/CMakeLists.txt
Diffstat (limited to 'host/lib/usrp/simple_usrp.cpp')
-rw-r--r--host/lib/usrp/simple_usrp.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/host/lib/usrp/simple_usrp.cpp b/host/lib/usrp/simple_usrp.cpp
index ebba5e137..40b71d355 100644
--- a/host/lib/usrp/simple_usrp.cpp
+++ b/host/lib/usrp/simple_usrp.cpp
@@ -18,6 +18,7 @@
#include <uhd/usrp/simple_usrp.hpp>
#include <uhd/usrp/tune_helper.hpp>
#include <uhd/utils/assert.hpp>
+#include <uhd/utils/gain_group.hpp>
#include <uhd/usrp/subdev_props.hpp>
#include <uhd/usrp/mboard_props.hpp>
#include <uhd/usrp/device_props.hpp>
@@ -132,15 +133,15 @@ public:
}
void set_rx_gain(float gain){
- _rx_subdev()[SUBDEV_PROP_GAIN] = gain;
+ return _rx_gain_group()->set_value(gain);
}
float get_rx_gain(void){
- return _rx_subdev()[SUBDEV_PROP_GAIN].as<float>();
+ return _rx_gain_group()->get_value();
}
gain_range_t get_rx_gain_range(void){
- return _rx_subdev()[SUBDEV_PROP_GAIN_RANGE].as<gain_range_t>();
+ return _rx_gain_group()->get_range();
}
void set_rx_antenna(const std::string &ant){
@@ -196,15 +197,15 @@ public:
}
void set_tx_gain(float gain){
- _tx_subdev()[SUBDEV_PROP_GAIN] = gain;
+ return _tx_gain_group()->set_value(gain);
}
float get_tx_gain(void){
- return _tx_subdev()[SUBDEV_PROP_GAIN].as<float>();
+ return _tx_gain_group()->get_value();
}
gain_range_t get_tx_gain_range(void){
- return _tx_subdev()[SUBDEV_PROP_GAIN_RANGE].as<gain_range_t>();
+ return _tx_gain_group()->get_range();
}
void set_tx_antenna(const std::string &ant){
@@ -250,6 +251,14 @@ private:
std::string sd_name = _mboard()[MBOARD_PROP_TX_SUBDEV_SPEC].as<subdev_spec_t>().front().sd_name;
return _tx_dboard()[named_prop_t(DBOARD_PROP_SUBDEV, sd_name)];
}
+ gain_group::sptr _rx_gain_group(void){
+ std::string sd_name = _mboard()[MBOARD_PROP_RX_SUBDEV_SPEC].as<subdev_spec_t>().front().sd_name;
+ return _rx_dboard()[named_prop_t(DBOARD_PROP_GAIN_GROUP, sd_name)].as<gain_group::sptr>();
+ }
+ gain_group::sptr _tx_gain_group(void){
+ std::string sd_name = _mboard()[MBOARD_PROP_TX_SUBDEV_SPEC].as<subdev_spec_t>().front().sd_name;
+ return _tx_dboard()[named_prop_t(DBOARD_PROP_GAIN_GROUP, sd_name)].as<gain_group::sptr>();
+ }
};
/***********************************************************************