laforge
/
openbts-osmo
Archived
1
0
Fork 0

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>
This commit is contained in:
Thomas Tsou 2011-08-01 19:52:35 -07:00
parent e64e4119ae
commit f8838172ad
2 changed files with 6 additions and 6 deletions

View File

@ -82,10 +82,10 @@ double RadioInterface::fullScaleOutputValue(void) {
void RadioInterface::setPowerAttenuation(double atten)
{
double rfAtten, digAtten;
double rfGain, digAtten;
rfAtten = usrp->setTxGain(usrp->maxTxGain() - atten);
digAtten = atten - rfAtten;
rfGain = usrp->setTxGain(usrp->maxTxGain() - atten);
digAtten = atten - usrp->maxTxGain() + rfGain;
if (digAtten < 1.0)
powerScaling = 1.0;

View File

@ -109,10 +109,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;