aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/device/lms/LMSDevice.cpp
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-12-07 11:13:55 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2018-12-07 11:18:32 +0100
commitfe865f45d79801f679ecba5b2f65f1626910b95e (patch)
tree40f6426e3addd59552b7064f7e51964e9d928a13 /Transceiver52M/device/lms/LMSDevice.cpp
parente5b666441987856316faa8b8928f40ec956906ac (diff)
lms: Do {under,over}run checks even if LMS_RecvStream fails
Under failure, it could still be that stream status is updated, so let's father that in all cases. Change-Id: I4e2b8be06d2993db1bab233948a8ee774b8ac4ee
Diffstat (limited to 'Transceiver52M/device/lms/LMSDevice.cpp')
-rw-r--r--Transceiver52M/device/lms/LMSDevice.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp
index fa9e395..5e21894 100644
--- a/Transceiver52M/device/lms/LMSDevice.cpp
+++ b/Transceiver52M/device/lms/LMSDevice.cpp
@@ -534,6 +534,7 @@ int LMSDevice::readSamples(std::vector < short *>&bufs, int len, bool * overrun,
for (i = 0; i<chans; i++) {
thread_enable_cancel(false);
rc = LMS_RecvStream(&m_lms_stream_rx[i], bufs[i], len, &rx_metadata, 100);
+ update_stream_stats(i, underrun, overrun);
if (rc != len) {
LOGC(DDEV, ALERT) << "LMS: Device receive timed out (" << rc << " vs exp " << len << ").";
thread_enable_cancel(true);
@@ -541,7 +542,6 @@ int LMSDevice::readSamples(std::vector < short *>&bufs, int len, bool * overrun,
}
if (timestamp != (TIMESTAMP)rx_metadata.timestamp)
LOGC(DDEV, ALERT) << "chan "<< i << " recv buffer of len " << rc << " expect " << std::hex << timestamp << " got " << std::hex << (TIMESTAMP)rx_metadata.timestamp << " (" << std::hex << rx_metadata.timestamp <<") diff=" << rx_metadata.timestamp - timestamp;
- update_stream_stats(i, underrun, overrun);
thread_enable_cancel(true);
}