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/+/15518
Change subject: LMSDevice: Return previous txGain/rxGain if setting value failed
......................................................................
LMSDevice: Return previous txGain/rxGain if setting value failed
Change-Id: I11e853e11bec99fc88e81642f9b2cd87d5815398
---
M Transceiver52M/device/lms/LMSDevice.cpp
M Transceiver52M/device/lms/LMSDevice.h
2 files changed, 10 insertions(+), 6 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/18/15518/1
diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp
index b7cb31d..feeb646 100644
--- a/Transceiver52M/device/lms/LMSDevice.cpp
+++ b/Transceiver52M/device/lms/LMSDevice.cpp
@@ -55,6 +55,8 @@
m_lms_stream_rx.resize(chans);
m_lms_stream_tx.resize(chans);
+ rx_gains.resize(chans);
+ tx_gains.resize(chans);
rx_buffers.resize(chans);
}
@@ -412,8 +414,9 @@
if (LMS_SetGaindB(m_lms_dev, LMS_CH_TX, chan, dB) < 0)
LOGCHAN(chan, DDEV, ERR) << "Error setting TX gain to " << dB << " dB";
-
- return dB;
+ else
+ tx_gains[chan] = dB;
+ return tx_gains[chan];
}
double LMSDevice::setRxGain(double dB, size_t chan)
@@ -427,8 +430,9 @@
if (LMS_SetGaindB(m_lms_dev, LMS_CH_RX, chan, dB) < 0)
LOGCHAN(chan, DDEV, ERR) << "Error setting RX gain to " << dB << " dB";
-
- return dB;
+ else
+ rx_gains[chan] = dB;
+ return rx_gains[chan];
}
void LMSDevice::log_ant_list(bool dir_tx, size_t chan, std::ostringstream& os)
diff --git a/Transceiver52M/device/lms/LMSDevice.h b/Transceiver52M/device/lms/LMSDevice.h
index ab45b08..71a706c 100644
--- a/Transceiver52M/device/lms/LMSDevice.h
+++ b/Transceiver52M/device/lms/LMSDevice.h
@@ -58,7 +58,7 @@
TIMESTAMP ts_initial, ts_offset;
- double rxGain;
+ std::vector<double> tx_gains, rx_gains;
double maxTxGainClamp;
bool do_calib(size_t chan);
@@ -150,7 +150,7 @@
/** get the current receive gain */
double getRxGain(size_t chan = 0) {
- return rxGain;
+ return rx_gains[chan];
}
/** return maximum Rx Gain **/
--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/15518
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I11e853e11bec99fc88e81642f9b2cd87d5815398
Gerrit-Change-Number: 15518
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/3955c0db/attachment.htm>