radioInterfaceMulti: Override setTxGain() to avoid chan!=0 calls
Change-Id: I7e67f660c3b0b009db59b405de603f6058021802
This commit is contained in:
parent
2ab921812e
commit
62845241a2
|
@ -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()
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue