lms: Allow values diff than 34dB to be set by setRxGain()

Until now, setRxGain in LMSDevice did not take into account the setter
parameter and was always using hardcoded 34dB, which was experimentally
found to be a good default value.

Let's force that value during initialization, but still allow the upper
layers (controlled by BTS) to set different values. osmo-bts only sends
a SETRXGAIN command (which calls setRxGain in osmo-trx) if a value is
explicitly set in its VTY config, so we are on the safe side if the user
doesn't explicitly configure a desired dB.

Change-Id: I5684e675281a3f581855dbb56d199a6fe238a712
This commit is contained in:
Pau Espin 2018-06-19 10:44:03 +02:00 committed by Harald Welte
parent 16e7e20f85
commit 58c89fb8d6
1 changed files with 1 additions and 3 deletions

View File

@ -223,7 +223,7 @@ bool LMSDevice::start()
// Set gains to midpoint
setTxGain((minTxGain() + maxTxGain()) / 2, i);
setRxGain((minRxGain() + maxRxGain()) / 2, i);
setRxGain(34.0, i);
m_lms_stream_rx[i] = {};
m_lms_stream_rx[i].isTx = false;
@ -327,8 +327,6 @@ double LMSDevice::setRxGain(double dB, size_t chan)
return 0.0;
}
dB = 34.0;
if (dB > maxRxGain())
dB = maxRxGain();
if (dB < minRxGain())