aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/device
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-04-24 18:43:51 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2018-04-24 18:46:48 +0200
commite564f0fd846a359944e050a92a5b50c4f2bdf3d0 (patch)
tree3b65ce1fe38fdb0c31b066c482dd694290dc5237 /Transceiver52M/device
parent0fc20d14b31c116b758dbfb9a1988b619270a034 (diff)
Transceiver: Move device specific code to radioDevice class
Diffstat (limited to 'Transceiver52M/device')
-rw-r--r--Transceiver52M/device/radioDevice.h5
-rw-r--r--Transceiver52M/device/uhd/UHDDevice.cpp10
-rw-r--r--Transceiver52M/device/usrp1/USRPDevice.cpp4
-rw-r--r--Transceiver52M/device/usrp1/USRPDevice.h3
4 files changed, 22 insertions, 0 deletions
diff --git a/Transceiver52M/device/radioDevice.h b/Transceiver52M/device/radioDevice.h
index 8915b17..44636d5 100644
--- a/Transceiver52M/device/radioDevice.h
+++ b/Transceiver52M/device/radioDevice.h
@@ -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;
diff --git a/Transceiver52M/device/uhd/UHDDevice.cpp b/Transceiver52M/device/uhd/UHDDevice.cpp
index ecdebe1..0d59bfc 100644
--- a/Transceiver52M/device/uhd/UHDDevice.cpp
+++ b/Transceiver52M/device/uhd/UHDDevice.cpp
@@ -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
diff --git a/Transceiver52M/device/usrp1/USRPDevice.cpp b/Transceiver52M/device/usrp1/USRPDevice.cpp
index 455528a..7f73f43 100644
--- a/Transceiver52M/device/usrp1/USRPDevice.cpp
+++ b/Transceiver52M/device/usrp1/USRPDevice.cpp
@@ -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)
diff --git a/Transceiver52M/device/usrp1/USRPDevice.h b/Transceiver52M/device/usrp1/USRPDevice.h
index 9091dea..6304ea1 100644
--- a/Transceiver52M/device/usrp1/USRPDevice.h
+++ b/Transceiver52M/device/usrp1/USRPDevice.h
@@ -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; }