aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkurtis.heimerl <kurtis.heimerl@19bc5d8c-e614-43d4-8b26-e1612bc8e597>2011-11-26 03:18:11 +0000
committerkurtis.heimerl <kurtis.heimerl@19bc5d8c-e614-43d4-8b26-e1612bc8e597>2011-11-26 03:18:11 +0000
commit16c654043c5a111de5c172d45609ded2324f952f (patch)
tree9abb6628321623619892eb7b3fbb0f825d189ea4
parent2b28c696f8dd5dad2fa002eaa9cd72c1f2b48cad (diff)
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 <ttsou@vt.edu> git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2662 19bc5d8c-e614-43d4-8b26-e1612bc8e597
-rw-r--r--Transceiver52M/radioInterface.cpp6
1 files changed, 3 insertions, 3 deletions
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;