diff --git a/lib/include/srslte/interfaces/ue_interfaces.h b/lib/include/srslte/interfaces/ue_interfaces.h index 7c1506cc8..82ff6caf1 100644 --- a/lib/include/srslte/interfaces/ue_interfaces.h +++ b/lib/include/srslte/interfaces/ue_interfaces.h @@ -213,7 +213,7 @@ public: class nas_interface_ue { public: - virtual void start_attach_request(srslte::proc_state_t* proc_result) = 0; + virtual void start_attach_request(srslte::proc_state_t* proc_result, srslte::establishment_cause_t cause_) = 0; virtual bool detach_request(const bool switch_off) = 0; }; diff --git a/srsue/hdr/stack/upper/nas.h b/srsue/hdr/stack/upper/nas.h index f7b57d1ac..bd42bee49 100644 --- a/srsue/hdr/stack/upper/nas.h +++ b/srsue/hdr/stack/upper/nas.h @@ -60,7 +60,7 @@ public: bool get_ipv6_addr(uint8_t* ipv6_addr); // UE interface - void start_attach_request(srslte::proc_state_t* result) final; + void start_attach_request(srslte::proc_state_t* result, srslte::establishment_cause_t cause_) final; bool detach_request(const bool switch_off) final; void plmn_search_completed(rrc_interface_nas::found_plmn_t found_plmns[rrc_interface_nas::MAX_FOUND_PLMNS], diff --git a/srsue/src/stack/ue_stack_lte.cc b/srsue/src/stack/ue_stack_lte.cc index 8a157296e..669d295da 100644 --- a/srsue/src/stack/ue_stack_lte.cc +++ b/srsue/src/stack/ue_stack_lte.cc @@ -167,7 +167,9 @@ void ue_stack_lte::stop_impl() bool ue_stack_lte::switch_on() { if (running) { - pending_tasks.try_push(ue_queue_id, task_t{[this](task_t*) { nas.start_attach_request(nullptr); }}); + pending_tasks.try_push(ue_queue_id, task_t{[this](task_t*) { + nas.start_attach_request(nullptr, srslte::establishment_cause_t::mo_data); + }}); return true; } return false; diff --git a/srsue/src/stack/upper/nas.cc b/srsue/src/stack/upper/nas.cc index 8a610cb96..0c952d7e2 100644 --- a/srsue/src/stack/upper/nas.cc +++ b/srsue/src/stack/upper/nas.cc @@ -307,7 +307,7 @@ void nas::timer_expired(uint32_t timeout_id) timers->get(t3411)->run(); } else if (timeout_id == t3411) { nas_log->info("Timer T3411 expired: trying to attach again\n"); - start_attach_request(nullptr); + start_attach_request(nullptr, srslte::establishment_cause_t::mo_sig); } else { nas_log->error("Timeout from unknown timer id %d\n", timeout_id); } @@ -321,7 +321,7 @@ void nas::timer_expired(uint32_t timeout_id) * The function returns true if the UE could attach correctly or false in case of error or timeout during attachment. * */ -void nas::start_attach_request(srslte::proc_state_t* result) +void nas::start_attach_request(srslte::proc_state_t* result, srslte::establishment_cause_t cause_) { nas_log->info("Attach Request\n"); switch (state) { @@ -382,7 +382,7 @@ void nas::start_attach_request(srslte::proc_state_t* result) } } else { nas_log->info("NAS is already registered but RRC disconnected. Connecting now...\n"); - if (not rrc_connector.launch(this, srslte::establishment_cause_t ::mo_data, nullptr)) { + if (not rrc_connector.launch(this, cause_, nullptr)) { nas_log->error("Cannot initiate concurrent rrc connection procedures\n"); if (result != nullptr) { *result = proc_state_t::error; diff --git a/srsue/src/stack/upper/usim.cc b/srsue/src/stack/upper/usim.cc index 1b1e29d59..2aa28da17 100644 --- a/srsue/src/stack/upper/usim.cc +++ b/srsue/src/stack/upper/usim.cc @@ -238,9 +238,7 @@ void usim::generate_as_keys(uint8_t *k_asme, { // Generate K_enb - security_generate_k_enb( k_asme, - count_ul, - k_enb); + security_generate_k_enb(k_asme, count_ul, k_enb); memcpy(this->k_asme, k_asme, 32); diff --git a/srsue/test/upper/nas_test.cc b/srsue/test/upper/nas_test.cc index 193327553..641bf91b0 100644 --- a/srsue/test/upper/nas_test.cc +++ b/srsue/test/upper/nas_test.cc @@ -144,7 +144,7 @@ public: bool switch_on() final { proc_state_t proc_result = proc_state_t::on_going; - nas->start_attach_request(&proc_result); + nas->start_attach_request(&proc_result, srslte::establishment_cause_t::mo_data); while (proc_result == proc_state_t::on_going) { usleep(1000); }