diff --git a/srsue/hdr/phy/phy.h b/srsue/hdr/phy/phy.h index 5a1ac14a7..53d4f6e13 100644 --- a/srsue/hdr/phy/phy.h +++ b/srsue/hdr/phy/phy.h @@ -78,6 +78,7 @@ public: void set_earfcn(std::vector earfcns); void force_freq(float dl_freq, float ul_freq); + void radio_overflow(); /********** RRC INTERFACE ********************/ void reset(); diff --git a/srsue/hdr/ue.h b/srsue/hdr/ue.h index b008b2fd5..763531261 100644 --- a/srsue/hdr/ue.h +++ b/srsue/hdr/ue.h @@ -73,13 +73,14 @@ public: void start_plot(); static void rf_msg(srslte_rf_error_t error); - void handle_rf_msg(srslte_rf_error_t error); // UE metrics interface bool get_metrics(ue_metrics_t &m); void pregenerate_signals(bool enable); + void radio_overflow(); + private: virtual ~ue(); diff --git a/srsue/hdr/ue_base.h b/srsue/hdr/ue_base.h index 9674a1486..256813d5f 100644 --- a/srsue/hdr/ue_base.h +++ b/srsue/hdr/ue_base.h @@ -156,6 +156,8 @@ public: virtual void stop() = 0; virtual bool is_attached() = 0; virtual void start_plot() = 0; + + virtual void radio_overflow() = 0; void handle_rf_msg(srslte_rf_error_t error); diff --git a/srsue/src/phy/phch_recv.cc b/srsue/src/phy/phch_recv.cc index de80d53c7..944a6e955 100644 --- a/srsue/src/phy/phch_recv.cc +++ b/srsue/src/phy/phch_recv.cc @@ -296,15 +296,17 @@ bool phch_recv::stop_sync() { usleep(10000); cnt++; } + if (!is_in_idle) { + Warning("SYNC: Could not go to IDLE\n"); + } return is_in_idle; } } void phch_recv::reset_sync() { - wait_radio_reset(); - Warning("SYNC: Resetting sync, cell_search_in_progress=%s\n", cell_search_in_progress?"yes":"no"); + search_p.reset(); srslte_ue_sync_reset(&ue_sync); resync_sfn(true, true); diff --git a/srsue/src/phy/phy.cc b/srsue/src/phy/phy.cc index 0763b09cb..820cf1351 100644 --- a/srsue/src/phy/phy.cc +++ b/srsue/src/phy/phy.cc @@ -352,6 +352,11 @@ int phy::prach_tx_tti() return prach_buffer.tx_tti(); } +// Handle the case of a radio overflow. Resynchronise inmediatly +void phy::radio_overflow() { + sf_recv.reset_sync(); +} + void phy::reset() { Info("Resetting PHY\n"); diff --git a/srsue/src/ue.cc b/srsue/src/ue.cc index 184cbcf56..a9277e62c 100644 --- a/srsue/src/ue.cc +++ b/srsue/src/ue.cc @@ -297,10 +297,17 @@ bool ue::get_metrics(ue_metrics_t &m) return false; } +void ue::radio_overflow() { + phy.radio_overflow(); +} + void ue::rf_msg(srslte_rf_error_t error) { ue_base *ue = ue_base::get_instance(LTE); ue->handle_rf_msg(error); + if(error.type == srslte_rf_error_t::SRSLTE_RF_ERROR_OVERFLOW) { + ue->radio_overflow(); + } } } // namespace srsue