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
This commit is contained in:
kurtis.heimerl 2011-11-26 03:18:11 +00:00
parent 2b28c696f8
commit 16c654043c
1 changed files with 3 additions and 3 deletions

View File

@ -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;