diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-04-24 17:48:52 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-04-24 18:46:48 +0200 |
commit | 0fc20d14b31c116b758dbfb9a1988b619270a034 (patch) | |
tree | ff698cfcc48ef527c50ad323e565ecdbcabfbe7f /Transceiver52M/device | |
parent | a4316ee4c5d2f097823616f1ca3fa82b2f25204c (diff) |
Move device specific code out of radioInterface
This way code of radioInterface is independent of the device and doesn't
need to be rebuild for each device.
Change-Id: Id104e1edef02f863b6465ced5b4241050dc188f9
Diffstat (limited to 'Transceiver52M/device')
-rw-r--r-- | Transceiver52M/device/radioDevice.h | 3 | ||||
-rw-r--r-- | Transceiver52M/device/uhd/UHDDevice.cpp | 7 | ||||
-rw-r--r-- | Transceiver52M/device/usrp1/USRPDevice.cpp | 4 | ||||
-rw-r--r-- | Transceiver52M/device/usrp1/USRPDevice.h | 3 |
4 files changed, 17 insertions, 0 deletions
diff --git a/Transceiver52M/device/radioDevice.h b/Transceiver52M/device/radioDevice.h index 9913de0..8915b17 100644 --- a/Transceiver52M/device/radioDevice.h +++ b/Transceiver52M/device/radioDevice.h @@ -148,6 +148,9 @@ class RadioDevice { /** return the used RX path */ virtual std::string getTxAntenna(size_t chan = 0) = 0; + /** return whether user drives synchronization of Tx/Rx of USRP */ + virtual bool requiresRadioAlign() = 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 4466da4..ecdebe1 100644 --- a/Transceiver52M/device/uhd/UHDDevice.cpp +++ b/Transceiver52M/device/uhd/UHDDevice.cpp @@ -255,6 +255,8 @@ public: bool setTxAntenna(const std::string &ant, size_t chan); std::string getTxAntenna(size_t chan); + bool requiresRadioAlign(); + inline double getSampleRate() { return tx_rate; } inline double numberRead() { return rx_pkt_cnt; } inline double numberWritten() { return 0; } @@ -1282,6 +1284,11 @@ std::string uhd_device::getTxAntenna(size_t chan) return usrp_dev->get_tx_antenna(chan); } +bool uhd_device::requiresRadioAlign() +{ + return false; +} + /* * 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 f7f24e9..455528a 100644 --- a/Transceiver52M/device/usrp1/USRPDevice.cpp +++ b/Transceiver52M/device/usrp1/USRPDevice.cpp @@ -353,6 +353,10 @@ std::string USRPDevice::getTxAntenna(size_t chan) return ""; } +bool USRPDevice::requiresRadioAlign() +{ + return true; +} // NOTE: Assumes sequential reads int USRPDevice::readSamples(std::vector<short *> &bufs, int len, bool *overrun, diff --git a/Transceiver52M/device/usrp1/USRPDevice.h b/Transceiver52M/device/usrp1/USRPDevice.h index f981643..9091dea 100644 --- a/Transceiver52M/device/usrp1/USRPDevice.h +++ b/Transceiver52M/device/usrp1/USRPDevice.h @@ -191,6 +191,9 @@ private: /* return the used RX path */ std::string getTxAntenna(size_t chan = 0); + /** return whether user drives synchronization of Tx/Rx of USRP */ + bool requiresRadioAlign(); + /** Return internal status values */ inline double getTxFreq(size_t chan = 0) { return 0; } inline double getRxFreq(size_t chan = 0) { return 0; } |