aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorttsou <ttsou@19bc5d8c-e614-43d4-8b26-e1612bc8e597>2012-01-09 18:11:34 +0000
committerttsou <ttsou@19bc5d8c-e614-43d4-8b26-e1612bc8e597>2012-01-09 18:11:34 +0000
commitb371ed54c780ca0b498a18c0efc692bc7b865862 (patch)
tree065b3d9990c983d3d97885f7bf66a39f84bf9fd5
parentd0093191d0eaed29b1bacb834f0922b95cb0fd6e (diff)
transceiver, uhd: alert user on unrecoverable errors
Unrecoverable device errors include send and receive timeouts and mangled packets. Other device errors, such as non-monotonic timestamps are sometimes recoverable through a soft restart. These fatal are generally limited to development versions of UHD driver or device firmware, but can occur in release versions. Alert user on such device errors along with current UHD version. Signed-off-by: Thomas Tsou <ttsou@vt.edu> git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@3012 19bc5d8c-e614-43d4-8b26-e1612bc8e597
-rw-r--r--Transceiver52M/UHDDevice.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp
index 17e7b35..5420575 100644
--- a/Transceiver52M/UHDDevice.cpp
+++ b/Transceiver52M/UHDDevice.cpp
@@ -22,6 +22,7 @@
#include "radioDevice.h"
#include "Threads.h"
#include "Logger.h"
+#include <uhd/version.hpp>
#include <uhd/property_tree.hpp>
#include <uhd/usrp/multi_usrp.hpp>
#include <uhd/utils/thread_priority.hpp>
@@ -574,6 +575,7 @@ int uhd_device::check_rx_md_err(uhd::rx_metadata_t &md, ssize_t num_smpls)
switch (md.error_code) {
case uhd::rx_metadata_t::ERROR_CODE_TIMEOUT:
+ LOG(ALERT) << "UHD: Receive timed out";
return ERROR_UNRECOVERABLE;
case uhd::rx_metadata_t::ERROR_CODE_OVERFLOW:
case uhd::rx_metadata_t::ERROR_CODE_LATE_COMMAND:
@@ -586,7 +588,7 @@ int uhd_device::check_rx_md_err(uhd::rx_metadata_t &md, ssize_t num_smpls)
// Missing timestamp
if (!md.has_time_spec) {
- LOG(ERR) << "UHD: Received packet missing timestamp";
+ LOG(ALERT) << "UHD: Received packet missing timestamp";
return ERROR_UNRECOVERABLE;
}
@@ -594,7 +596,8 @@ int uhd_device::check_rx_md_err(uhd::rx_metadata_t &md, ssize_t num_smpls)
// Monotonicity check
if (ts < prev_ts) {
- LOG(ERR) << "UHD: Loss of monotonic: " << ts.get_real_secs();
+ LOG(ALERT) << "UHD: Loss of monotonic time";
+ LOG(ERR) << "UHD: Current time: " << ts.get_real_secs();
LOG(ERR) << "UHD: Previous time: " << prev_ts.get_real_secs();
return ERROR_TIMING;
} else {
@@ -644,7 +647,8 @@ int uhd_device::readSamples(short *buf, int len, bool *overrun,
rc = check_rx_md_err(metadata, num_smpls);
switch (rc) {
case ERROR_UNRECOVERABLE:
- LOG(ALERT) << "Unrecoverable error, exiting...";
+ LOG(ALERT) << "UHD: Version " << uhd::get_version_string();
+ LOG(ALERT) << "UHD: Unrecoverable error, exiting...";
exit(-1);
case ERROR_TIMING:
restart(prev_ts);
@@ -720,8 +724,12 @@ int uhd_device::writeSamples(short *buf, int len, bool *underrun,
uhd::io_type_t::COMPLEX_INT16,
uhd::device::SEND_MODE_FULL_BUFF);
- if (num_smpls != (unsigned)len)
- LOG(ERR) << "UHD: Sent fewer samples than requested";
+ if (num_smpls != (unsigned) len) {
+ LOG(ALERT) << "UHD: Device send timed out";
+ LOG(ALERT) << "UHD: Version " << uhd::get_version_string();
+ LOG(ALERT) << "UHD: Unrecoverable error, exiting...";
+ exit(-1);
+ }
return num_smpls;
}