radioInterfaceMulti: Override setTxGain() to avoid chan!=0 calls

Change-Id: I7e67f660c3b0b009db59b405de603f6058021802
This commit is contained in:
Pau Espin 2019-09-13 17:29:21 +02:00
parent 2ab921812e
commit 62845241a2
3 changed files with 19 additions and 1 deletions

View File

@ -112,7 +112,7 @@ int RadioInterface::setPowerAttenuation(int atten, size_t chan)
if (atten < 0.0)
atten = 0.0;
rfGain = mDevice->setTxGain(mDevice->maxTxGain() - (double) atten, chan);
rfGain = setTxGain(mDevice->maxTxGain() - (double) atten, chan);
digAtten = (double) atten - mDevice->maxTxGain() + rfGain;
if (digAtten < 1.0)
@ -307,6 +307,11 @@ double RadioInterface::setRxGain(double dB, size_t chan)
return mDevice->setRxGain(dB, chan);
}
double RadioInterface::setTxGain(double dB, size_t chan)
{
return mDevice->setTxGain(dB, chan);
}
/* Receive a timestamped chunk from the device */
int RadioInterface::pullBuffer()
{

View File

@ -134,6 +134,9 @@ protected:
/** drive synchronization of Tx/Rx of USRP */
void alignRadio();
/** set transmit gain */
virtual double setTxGain(double dB, size_t chan = 0);
friend void *AlignRadioServiceLoopAdapter(RadioInterface*);
};
@ -157,6 +160,7 @@ class RadioInterfaceMulti : public RadioInterface {
private:
bool pushBuffer();
int pullBuffer();
virtual double setTxGain(double dB, size_t chan);
signalVector *outerSendBuffer;
signalVector *outerRecvBuffer;

View File

@ -405,3 +405,12 @@ double RadioInterfaceMulti::setRxGain(double db, size_t chan)
else
return mDevice->getRxGain();
}
double RadioInterfaceMulti::setTxGain(double dB, size_t chan)
{
if (chan == 0)
return mDevice->setTxGain(dB);
else
return mDevice->getTxGain();
}