From 16c654043c5a111de5c172d45609ded2324f952f Mon Sep 17 00:00:00 2001 From: "kurtis.heimerl" Date: Sat, 26 Nov 2011 03:18:11 +0000 Subject: transceiver: fix bug in setting low-level attenuation This patch fixes some confusion in gain vs. attenuation setting. The UHD device is controlled through gain settings but OpenBTS represents gain in terms of attenuation relative to maximum - 0 dB attenuation. Signed-off-by: Thomas Tsou git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2662 19bc5d8c-e614-43d4-8b26-e1612bc8e597 --- Transceiver52M/radioInterface.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Transceiver52M') diff --git a/Transceiver52M/radioInterface.cpp b/Transceiver52M/radioInterface.cpp index 1afa01b..531a0dd 100644 --- a/Transceiver52M/radioInterface.cpp +++ b/Transceiver52M/radioInterface.cpp @@ -103,10 +103,10 @@ double RadioInterface::fullScaleOutputValue(void) { void RadioInterface::setPowerAttenuation(double atten) { - double rfAtten, digAtten; + double rfGain, digAtten; - rfAtten = mRadio->setTxGain(mRadio->maxTxGain() - atten); - digAtten = atten - rfAtten; + rfGain = mRadio->setTxGain(mRadio->maxTxGain() - atten); + digAtten = atten - mRadio->maxTxGain() + rfGain; if (digAtten < 1.0) powerScaling = 1.0; -- cgit v1.2.3