diff --git a/Transceiver52M/device/common/radioDevice.h b/Transceiver52M/device/common/radioDevice.h index b4928f28..1d852044 100644 --- a/Transceiver52M/device/common/radioDevice.h +++ b/Transceiver52M/device/common/radioDevice.h @@ -131,6 +131,9 @@ class RadioDevice { /** sets the transmit chan gain, returns the gain setting **/ virtual double setTxGain(double dB, size_t chan = 0) = 0; + /** get transmit gain */ + virtual double getTxGain(size_t chan = 0) = 0; + /** return maximum Tx Gain **/ virtual double maxTxGain(void) = 0; diff --git a/Transceiver52M/device/lms/LMSDevice.h b/Transceiver52M/device/lms/LMSDevice.h index 71a706ca..1464c530 100644 --- a/Transceiver52M/device/lms/LMSDevice.h +++ b/Transceiver52M/device/lms/LMSDevice.h @@ -162,6 +162,11 @@ public: /** sets the transmit chan gain, returns the gain setting **/ double setTxGain(double dB, size_t chan = 0); + /** get transmit gain */ + double getTxGain(size_t chan = 0) { + return tx_gains[chan]; + } + /** return maximum Tx Gain **/ double maxTxGain(void); diff --git a/Transceiver52M/device/uhd/UHDDevice.cpp b/Transceiver52M/device/uhd/UHDDevice.cpp index 5b38df46..3b592912 100644 --- a/Transceiver52M/device/uhd/UHDDevice.cpp +++ b/Transceiver52M/device/uhd/UHDDevice.cpp @@ -310,6 +310,19 @@ double uhd_device::getRxGain(size_t chan) return rx_gains[chan]; } +double uhd_device::getTxGain(size_t chan) +{ + if (iface == MULTI_ARFCN) + chan = 0; + + if (chan >= tx_gains.size()) { + LOGC(DDEV, ALERT) << "Requested non-existent channel " << chan; + return 0.0f; + } + + return tx_gains[chan]; +} + /* Parse the UHD device tree and mboard name to find out what device we're dealing with. We need the window type so that the transceiver knows how to diff --git a/Transceiver52M/device/uhd/UHDDevice.h b/Transceiver52M/device/uhd/UHDDevice.h index 944578a0..44f7ebbe 100644 --- a/Transceiver52M/device/uhd/UHDDevice.h +++ b/Transceiver52M/device/uhd/UHDDevice.h @@ -96,6 +96,7 @@ public: double minRxGain(void) { return rx_gain_min; } double setTxGain(double db, size_t chan); + double getTxGain(size_t chan = 0); double maxTxGain(void) { return tx_gain_max; } double minTxGain(void) { return tx_gain_min; } diff --git a/Transceiver52M/device/usrp1/USRPDevice.h b/Transceiver52M/device/usrp1/USRPDevice.h index 734b3613..bb70648d 100644 --- a/Transceiver52M/device/usrp1/USRPDevice.h +++ b/Transceiver52M/device/usrp1/USRPDevice.h @@ -171,6 +171,9 @@ private: /** sets the transmit chan gain, returns the gain setting **/ double setTxGain(double dB, size_t chan = 0); + /** get transmit gain */ + double getTxGain(size_t chan = 0) { return txGain; } + /** return maximum Tx Gain **/ double maxTxGain(void);