From 931cfa2db91fa6f1599ef120ffe0b140e88a2919 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Wed, 20 Sep 2017 22:47:14 +0200 Subject: [PATCH] Add source of Late message --- lib/src/phy/rf/rf_uhd_imp.c | 9 +++++---- srsue/src/ue_base.cc | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/src/phy/rf/rf_uhd_imp.c b/lib/src/phy/rf/rf_uhd_imp.c index 78f1d033e..8f0e5a0c0 100644 --- a/lib/src/phy/rf/rf_uhd_imp.c +++ b/lib/src/phy/rf/rf_uhd_imp.c @@ -76,9 +76,10 @@ static void log_overflow(rf_uhd_handler_t *h) { } } -static void log_late(rf_uhd_handler_t *h) { +static void log_late(rf_uhd_handler_t *h, bool is_rx) { if (h->uhd_error_handler) { - srslte_rf_error_t error; + srslte_rf_error_t error; + error.opt = is_rx?1:0; bzero(&error, sizeof(srslte_rf_error_t)); error.type = SRSLTE_RF_ERROR_LATE; h->uhd_error_handler(error); @@ -109,7 +110,7 @@ static void* async_thread(void *h) { event_code == UHD_ASYNC_METADATA_EVENT_CODE_UNDERFLOW_IN_PACKET) { log_underflow(handler); } else if (event_code == UHD_ASYNC_METADATA_EVENT_CODE_TIME_ERROR) { - log_late(handler); + log_late(handler, false); } } } else { @@ -647,7 +648,7 @@ int rf_uhd_recv_with_time_multi(void *h, if (error_code == UHD_RX_METADATA_ERROR_CODE_OVERFLOW) { log_overflow(handler); } else if (error_code == UHD_RX_METADATA_ERROR_CODE_LATE_COMMAND) { - log_late(handler); + log_late(handler, true); } else if (error_code == UHD_RX_METADATA_ERROR_CODE_TIMEOUT) { fprintf(stderr, "Error timed out while receiving samples from UHD.\n"); return -1; diff --git a/srsue/src/ue_base.cc b/srsue/src/ue_base.cc index c84393ae4..94b9b5155 100644 --- a/srsue/src/ue_base.cc +++ b/srsue/src/ue_base.cc @@ -88,7 +88,7 @@ void ue_base::handle_rf_msg(srslte_rf_error_t error) } else if(error.type == srslte_rf_error_t::SRSLTE_RF_ERROR_LATE) { rf_metrics.rf_l++; rf_metrics.rf_error = true; - rf_log.warning("Late\n"); + rf_log.warning("Late (detected in %s)\n", error.opt?"rx call":"asynchronous thread"); } else if (error.type == srslte_rf_error_t::SRSLTE_RF_ERROR_OTHER) { std::string str(error.msg); str.erase(std::remove(str.begin(), str.end(), '\n'), str.end());