Transceiver: Move device specific code to radioDevice class
Change-Id: Ibcf258d8bf8595e286682e0bc59391b239ea7642
This commit is contained in:
parent
0fc20d14b3
commit
e564f0fd84
|
@ -35,12 +35,6 @@ using namespace GSM;
|
|||
|
||||
#define USB_LATENCY_INTRVL 10,0
|
||||
|
||||
#if USE_UHD
|
||||
# define USB_LATENCY_MIN 6,7
|
||||
#else
|
||||
# define USB_LATENCY_MIN 1,1
|
||||
#endif
|
||||
|
||||
/* Number of running values use in noise average */
|
||||
#define NOISE_CNT 20
|
||||
|
||||
|
@ -994,7 +988,7 @@ void Transceiver::driveTxFIFO()
|
|||
else {
|
||||
// if underrun hasn't occurred in the last sec (216 frames) drop
|
||||
// transmit latency by a timeslot
|
||||
if (mTransmitLatency > GSM::Time(USB_LATENCY_MIN)) {
|
||||
if (mTransmitLatency > mRadioInterface->minLatency()) {
|
||||
if (radioClock->get() > mLatencyUpdateTime + GSM::Time(216,0)) {
|
||||
mTransmitLatency.decTN();
|
||||
LOG(INFO) << "reduced latency: " << mTransmitLatency;
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "GSMCommon.h"
|
||||
|
||||
extern "C" {
|
||||
#include "config_defs.h"
|
||||
}
|
||||
|
@ -151,6 +153,9 @@ class RadioDevice {
|
|||
/** return whether user drives synchronization of Tx/Rx of USRP */
|
||||
virtual bool requiresRadioAlign() = 0;
|
||||
|
||||
/** Minimum latency that the device can achieve */
|
||||
virtual GSM::Time minLatency() = 0;
|
||||
|
||||
/** Return internal status values */
|
||||
virtual double getTxFreq(size_t chan = 0) = 0;
|
||||
virtual double getRxFreq(size_t chan = 0) = 0;
|
||||
|
|
|
@ -257,6 +257,8 @@ public:
|
|||
|
||||
bool requiresRadioAlign();
|
||||
|
||||
GSM::Time minLatency();
|
||||
|
||||
inline double getSampleRate() { return tx_rate; }
|
||||
inline double numberRead() { return rx_pkt_cnt; }
|
||||
inline double numberWritten() { return 0; }
|
||||
|
@ -1289,6 +1291,14 @@ bool uhd_device::requiresRadioAlign()
|
|||
return false;
|
||||
}
|
||||
|
||||
GSM::Time uhd_device::minLatency() {
|
||||
/* Empirical data from a handful of
|
||||
relatively recent machines shows that the B100 will underrun when
|
||||
the transmit threshold is reduced to a time of 6 and a half frames,
|
||||
so we set a minimum 7 frame threshold. */
|
||||
return GSM::Time(6,7);
|
||||
}
|
||||
|
||||
/*
|
||||
* Only allow sampling the Rx path lower than Tx and not vice-versa.
|
||||
* Using Tx with 4 SPS and Rx at 1 SPS is the only allowed mixed
|
||||
|
|
|
@ -358,6 +358,10 @@ bool USRPDevice::requiresRadioAlign()
|
|||
return true;
|
||||
}
|
||||
|
||||
GSM::Time USRPDevice::minLatency() {
|
||||
return GSM::Time(1,1);
|
||||
}
|
||||
|
||||
// NOTE: Assumes sequential reads
|
||||
int USRPDevice::readSamples(std::vector<short *> &bufs, int len, bool *overrun,
|
||||
TIMESTAMP timestamp, bool *underrun, unsigned *RSSI)
|
||||
|
|
|
@ -194,6 +194,9 @@ private:
|
|||
/** return whether user drives synchronization of Tx/Rx of USRP */
|
||||
bool requiresRadioAlign();
|
||||
|
||||
/** return whether user drives synchronization of Tx/Rx of USRP */
|
||||
virtual GSM::Time minLatency();
|
||||
|
||||
/** Return internal status values */
|
||||
inline double getTxFreq(size_t chan = 0) { return 0; }
|
||||
inline double getRxFreq(size_t chan = 0) { return 0; }
|
||||
|
|
|
@ -133,6 +133,9 @@ public:
|
|||
/** get transport window type of attached device */
|
||||
enum RadioDevice::TxWindowType getWindowType() { return mRadio->getWindowType(); }
|
||||
|
||||
/** Minimum latency that the device can achieve */
|
||||
GSM::Time minLatency() { return mRadio->minLatency(); }
|
||||
|
||||
protected:
|
||||
/** drive synchronization of Tx/Rx of USRP */
|
||||
void alignRadio();
|
||||
|
|
Loading…
Reference in New Issue