From ae23cfbac7baa1d019f44d67d5a4c631e48361aa Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Tue, 23 Oct 2018 18:52:17 +0200 Subject: [PATCH] send detach request in connection request if RRC is not connected --- srsue/src/upper/nas.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/srsue/src/upper/nas.cc b/srsue/src/upper/nas.cc index ac1abdf63..aa42fe429 100644 --- a/srsue/src/upper/nas.cc +++ b/srsue/src/upper/nas.cc @@ -184,7 +184,7 @@ bool nas::detach_request() { case EMM_STATE_REGISTERED: // send detach request send_detach_request(true); - state = EMM_STATE_DEREGISTERED_INITIATED; + state = EMM_STATE_DEREGISTERED; break; case EMM_STATE_DEREGISTERED_INITIATED: // do nothing .. @@ -1337,7 +1337,11 @@ void nas::send_detach_request(bool switch_off) } nas_log->info("Sending detach request\n"); - rrc->write_sdu(cfg.lcid, pdu); + if (rrc->is_connected()) { + rrc->write_sdu(cfg.lcid, pdu); + } else { + rrc->connection_request(LIBLTE_RRC_CON_REQ_EST_CAUSE_MO_SIGNALLING, pdu); + } } void nas::send_detach_accept()