From 9775ddc5215b0d5c950757ac6ae1d3226784f670 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sat, 24 Jul 2010 00:02:10 -0700 Subject: usrp: added gain group support usrp2 dboard and to wrapper implementations --- host/lib/usrp/mimo_usrp.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'host/lib/usrp/mimo_usrp.cpp') diff --git a/host/lib/usrp/mimo_usrp.cpp b/host/lib/usrp/mimo_usrp.cpp index ec0f1dcc8..6b9318c39 100644 --- a/host/lib/usrp/mimo_usrp.cpp +++ b/host/lib/usrp/mimo_usrp.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -56,11 +57,13 @@ public: _rx_dboards.push_back(_mboards.back()[MBOARD_PROP_RX_DBOARD]); std::string rx_subdev_in_use = _rx_dboards.back()[DBOARD_PROP_USED_SUBDEVS].as().at(0); _rx_subdevs.push_back(_rx_dboards.back()[named_prop_t(DBOARD_PROP_SUBDEV, rx_subdev_in_use)]); + _rx_gain_groups.push_back(_rx_dboards.back()[named_prop_t(DBOARD_PROP_GAIN_GROUP, rx_subdev_in_use)].as()); //extract tx subdevice _tx_dboards.push_back(_mboards.back()[MBOARD_PROP_TX_DBOARD]); std::string tx_subdev_in_use = _tx_dboards.back()[DBOARD_PROP_USED_SUBDEVS].as().at(0); _tx_subdevs.push_back(_tx_dboards.back()[named_prop_t(DBOARD_PROP_SUBDEV, tx_subdev_in_use)]); + _tx_gain_groups.push_back(_tx_dboards.back()[named_prop_t(DBOARD_PROP_GAIN_GROUP, tx_subdev_in_use)].as()); } //set the clock config across all mboards (TODO set through api) @@ -201,15 +204,15 @@ public: } void set_rx_gain(size_t chan, float gain){ - _rx_subdevs.at(chan)[SUBDEV_PROP_GAIN] = gain; + _rx_gain_groups.at(chan)->set_value(gain); } float get_rx_gain(size_t chan){ - return _rx_subdevs.at(chan)[SUBDEV_PROP_GAIN].as(); + return _rx_gain_groups.at(chan)->get_value(); } gain_range_t get_rx_gain_range(size_t chan){ - return _rx_subdevs.at(chan)[SUBDEV_PROP_GAIN_RANGE].as(); + return _rx_gain_groups.at(chan)->get_range(); } void set_rx_antenna(size_t chan, const std::string &ant){ @@ -268,15 +271,15 @@ public: } void set_tx_gain(size_t chan, float gain){ - _tx_subdevs.at(chan)[SUBDEV_PROP_GAIN] = gain; + _tx_gain_groups.at(chan)->set_value(gain); } float get_tx_gain(size_t chan){ - return _tx_subdevs.at(chan)[SUBDEV_PROP_GAIN].as(); + return _tx_gain_groups.at(chan)->get_value(); } gain_range_t get_tx_gain_range(size_t chan){ - return _tx_subdevs.at(chan)[SUBDEV_PROP_GAIN_RANGE].as(); + return _tx_gain_groups.at(chan)->get_range(); } void set_tx_antenna(size_t chan, const std::string &ant){ @@ -304,6 +307,8 @@ private: std::vector _tx_dboards; std::vector _rx_subdevs; std::vector _tx_subdevs; + std::vector _rx_gain_groups; + std::vector _tx_gain_groups; //shadows double _rx_rate, _tx_rate; -- cgit v1.2.3