This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
pespin gerrit-no-reply at lists.osmocom.orgpespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-trx/+/15520 Change subject: radioDevice: Introduce getTxGain() API ...................................................................... radioDevice: Introduce getTxGain() API It will be used in later commits by radioInterfaceMulti. Change-Id: Ie3caca8971ed1e5370dfed6fb60716a24e7d82a5 --- M Transceiver52M/device/common/radioDevice.h M Transceiver52M/device/lms/LMSDevice.h M Transceiver52M/device/uhd/UHDDevice.cpp M Transceiver52M/device/uhd/UHDDevice.h M Transceiver52M/device/usrp1/USRPDevice.h 5 files changed, 25 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/20/15520/1 diff --git a/Transceiver52M/device/common/radioDevice.h b/Transceiver52M/device/common/radioDevice.h index b4928f2..1d85204 100644 --- a/Transceiver52M/device/common/radioDevice.h +++ b/Transceiver52M/device/common/radioDevice.h @@ -131,6 +131,9 @@ /** 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 71a706c..1464c53 100644 --- a/Transceiver52M/device/lms/LMSDevice.h +++ b/Transceiver52M/device/lms/LMSDevice.h @@ -162,6 +162,11 @@ /** 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 5b38df4..3b59291 100644 --- a/Transceiver52M/device/uhd/UHDDevice.cpp +++ b/Transceiver52M/device/uhd/UHDDevice.cpp @@ -310,6 +310,19 @@ 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 944578a..44f7ebb 100644 --- a/Transceiver52M/device/uhd/UHDDevice.h +++ b/Transceiver52M/device/uhd/UHDDevice.h @@ -96,6 +96,7 @@ 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 734b361..bb70648 100644 --- a/Transceiver52M/device/usrp1/USRPDevice.h +++ b/Transceiver52M/device/usrp1/USRPDevice.h @@ -171,6 +171,9 @@ /** 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); -- To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/15520 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Change-Id: Ie3caca8971ed1e5370dfed6fb60716a24e7d82a5 Gerrit-Change-Number: 15520 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin at sysmocom.de> Gerrit-MessageType: newchange -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190913/26fa6225/attachment.htm>