From 25ab36ddd5230e5b90e48092134bdc2c3cf1294d Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Fri, 1 May 2020 14:52:24 +0200 Subject: [PATCH] nas: fix UE not attaching if PLMN isn't found after switching on if no cell/PLMN can be found if the UE is switched on, the UE was never trying again. In theory this would be handled by T3410, but the timer is not started in case the PLMN search isn't done yet. --- srsue/src/stack/upper/nas.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/srsue/src/stack/upper/nas.cc b/srsue/src/stack/upper/nas.cc index dd27ed5ba..d0777950c 100644 --- a/srsue/src/stack/upper/nas.cc +++ b/srsue/src/stack/upper/nas.cc @@ -398,11 +398,15 @@ void nas::start_attach_proc(srslte::proc_state_t* result, srslte::establishment_ } return; } - plmn_searcher.then([this, result](const proc_state_t& res) { + plmn_searcher.then([this, result, cause_](const proc_state_t& res) { nas_log->info("Attach Request from PLMN Search %s\n", res.is_success() ? "finished successfully" : "failed"); if (result != nullptr) { *result = res; } + if (!res.is_success()) { + // try again .. + task_handler->defer_callback(reattach_timer_duration_ms, [&]() { start_attach_proc(nullptr, cause_); }); + } }); } else { nas_log->info("PLMN selected in state %s\n", emm_state_text[state]);