aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/mimo_usrp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/usrp/mimo_usrp.cpp')
-rw-r--r--host/lib/usrp/mimo_usrp.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/host/lib/usrp/mimo_usrp.cpp b/host/lib/usrp/mimo_usrp.cpp
index 34dee42b8..7965e4016 100644
--- a/host/lib/usrp/mimo_usrp.cpp
+++ b/host/lib/usrp/mimo_usrp.cpp
@@ -18,6 +18,7 @@
#include <uhd/usrp/mimo_usrp.hpp>
#include <uhd/usrp/tune_helper.hpp>
#include <uhd/utils/assert.hpp>
+#include <uhd/utils/gain_group.hpp>
#include <uhd/utils/algorithm.hpp>
#include <uhd/utils/warning.hpp>
#include <uhd/usrp/subdev_props.hpp>
@@ -190,15 +191,15 @@ public:
}
void set_rx_gain(size_t chan, float gain){
- _rx_subdev(chan)[SUBDEV_PROP_GAIN] = gain;
+ return _rx_gain_group(chan)->set_value(gain);
}
float get_rx_gain(size_t chan){
- return _rx_subdev(chan)[SUBDEV_PROP_GAIN].as<float>();
+ return _rx_gain_group(chan)->get_value();
}
gain_range_t get_rx_gain_range(size_t chan){
- return _rx_subdev(chan)[SUBDEV_PROP_GAIN_RANGE].as<gain_range_t>();
+ return _rx_gain_group(chan)->get_range();
}
void set_rx_antenna(size_t chan, const std::string &ant){
@@ -262,15 +263,15 @@ public:
}
void set_tx_gain(size_t chan, float gain){
- _tx_subdev(chan)[SUBDEV_PROP_GAIN] = gain;
+ return _tx_gain_group(chan)->set_value(gain);
}
float get_tx_gain(size_t chan){
- return _tx_subdev(chan)[SUBDEV_PROP_GAIN].as<float>();
+ return _tx_gain_group(chan)->get_value();
}
gain_range_t get_tx_gain_range(size_t chan){
- return _tx_subdev(chan)[SUBDEV_PROP_GAIN_RANGE].as<gain_range_t>();
+ return _tx_gain_group(chan)->get_range();
}
void set_tx_antenna(size_t chan, const std::string &ant){
@@ -317,6 +318,14 @@ private:
std::string sd_name = _mboard(chan)[MBOARD_PROP_TX_SUBDEV_SPEC].as<subdev_spec_t>().front().sd_name;
return _tx_dboard(chan)[named_prop_t(DBOARD_PROP_SUBDEV, sd_name)];
}
+ gain_group::sptr _rx_gain_group(size_t chan){
+ std::string sd_name = _mboard(chan)[MBOARD_PROP_RX_SUBDEV_SPEC].as<subdev_spec_t>().front().sd_name;
+ return _rx_dboard(chan)[named_prop_t(DBOARD_PROP_GAIN_GROUP, sd_name)].as<gain_group::sptr>();
+ }
+ gain_group::sptr _tx_gain_group(size_t chan){
+ std::string sd_name = _mboard(chan)[MBOARD_PROP_TX_SUBDEV_SPEC].as<subdev_spec_t>().front().sd_name;
+ return _tx_dboard(chan)[named_prop_t(DBOARD_PROP_GAIN_GROUP, sd_name)].as<gain_group::sptr>();
+ }
//shadows
double _rx_rate, _tx_rate;