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>
master
Thomas Tsou 11 years ago
parent e64e4119ae
commit f8838172ad
  1. 6
      public-trunk/Transceiver/radioInterface.cpp
  2. 6
      public-trunk/Transceiver52M/radioInterface.cpp

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

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