From ed52604d3001e0237eb6f2a0b89cd990c2f988c9 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Sun, 4 Mar 2018 21:51:14 +0100 Subject: [PATCH] Restart rx_stream on radio error --- lib/src/radio/radio.cc | 7 ++----- srsue/src/phy/phch_recv.cc | 12 +++--------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/lib/src/radio/radio.cc b/lib/src/radio/radio.cc index ba2b1d1f0..7008790a3 100644 --- a/lib/src/radio/radio.cc +++ b/lib/src/radio/radio.cc @@ -87,11 +87,8 @@ void radio::stop() void radio::reset() { printf("Resetting Radio...\n"); - srslte_rf_close(&rf_device); - sleep(3); - if (srslte_rf_open_devname(&rf_device, saved_devname, saved_args, saved_nof_channels)) { - fprintf(stderr, "Error opening RF device\n"); - } + srslte_rf_stop_rx_stream(&rf_device); + radio_is_streaming = false; } void radio::set_manual_calibration(rf_cal_t* calibration) diff --git a/srsue/src/phy/phch_recv.cc b/srsue/src/phy/phch_recv.cc index 7a3efeab7..a6f1a5d84 100644 --- a/srsue/src/phy/phch_recv.cc +++ b/srsue/src/phy/phch_recv.cc @@ -143,16 +143,10 @@ void phch_recv::reset() void phch_recv::radio_error() { log_h->error("SYNC: Receiving from radio.\n"); - phy_state = IDLE; - - // Need to find a method to effectively reset radio, reloading the driver does not work - //radio_h->reset(); - radio_h->stop(); - - fprintf(stdout, "Error while receiving samples. Restart srsUE\n"); - exit(-1); - + phy_state = CELL_SEARCH; reset(); + // Need to find a method to effectively reset radio, reloading the driver does not work + radio_h->reset(); } void phch_recv::set_cfo(float cfo) {