diff options
author | Josh Blum <josh@joshknows.com> | 2010-08-06 15:18:02 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-08-06 15:18:02 -0700 |
commit | 03ccbeb6411c0c13adf54bde4c19372ffa141aa0 (patch) | |
tree | b3b1c1b801495775db74b0c66f273166131b68a0 /host/lib/usrp/mimo_usrp.cpp | |
parent | 5fe5ff0655a410aac686d130daf9a77e39fd01b5 (diff) | |
parent | d1711722dd432ba63b54f93d92270d4050465204 (diff) | |
download | uhd-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/mimo_usrp.cpp')
-rw-r--r-- | host/lib/usrp/mimo_usrp.cpp | 21 |
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; |