From c6f4776a6f227e9f5345e002ae6928880a839f41 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Mon, 28 Sep 2020 11:32:33 +0100 Subject: [PATCH] send the nassdus sooner in the rrc reconf procedure --- srsue/hdr/stack/rrc/rrc_procedures.h | 2 -- srsue/src/stack/rrc/rrc_procedures.cc | 32 +++++++++++---------------- 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/srsue/hdr/stack/rrc/rrc_procedures.h b/srsue/hdr/stack/rrc/rrc_procedures.h index 9dd058228..97ba074ce 100644 --- a/srsue/hdr/stack/rrc/rrc_procedures.h +++ b/srsue/hdr/stack/rrc/rrc_procedures.h @@ -208,8 +208,6 @@ public: void then(const srslte::proc_state_t& result); private: - srslte::proc_outcome_t handle_recfg_complete(); - // const rrc* rrc_ptr; // args diff --git a/srsue/src/stack/rrc/rrc_procedures.cc b/srsue/src/stack/rrc/rrc_procedures.cc index b732c34bb..b38eb9184 100644 --- a/srsue/src/stack/rrc/rrc_procedures.cc +++ b/srsue/src/stack/rrc/rrc_procedures.cc @@ -990,6 +990,19 @@ srslte::proc_outcome_t rrc::connection_reconf_no_ho_proc::init(const asn1::rrc:: return proc_outcome_t::error; } + srslte::unique_byte_buffer_t nas_sdu; + for (uint32_t i = 0; i < rx_recfg.ded_info_nas_list.size(); i++) { + nas_sdu = srslte::allocate_unique_buffer(*rrc_ptr->pool); + if (nas_sdu.get()) { + memcpy(nas_sdu->msg, rx_recfg.ded_info_nas_list[i].data(), rx_recfg.ded_info_nas_list[i].size()); + nas_sdu->N_bytes = rx_recfg.ded_info_nas_list[i].size(); + rrc_ptr->nas->write_pdu(RB_ID_SRB1, std::move(nas_sdu)); + } else { + rrc_ptr->rrc_log->error("Fatal Error: Couldn't allocate PDU in %s.\n", __FUNCTION__); + return proc_outcome_t::error; + } + } + // Wait for PHY configurations to be complete if (std::count(&rrc_ptr->current_scell_configured[0], &rrc_ptr->current_scell_configured[SRSLTE_MAX_CARRIERS], true) > 0) { @@ -1014,26 +1027,7 @@ srslte::proc_outcome_t rrc::connection_reconf_no_ho_proc::react(const bool& conf return proc_outcome_t::yield; } - return handle_recfg_complete(); -} - -srslte::proc_outcome_t rrc::connection_reconf_no_ho_proc::handle_recfg_complete() -{ rrc_ptr->send_rrc_con_reconfig_complete(); - - srslte::unique_byte_buffer_t nas_sdu; - for (uint32_t i = 0; i < rx_recfg.ded_info_nas_list.size(); i++) { - nas_sdu = srslte::allocate_unique_buffer(*rrc_ptr->pool); - if (nas_sdu.get()) { - memcpy(nas_sdu->msg, rx_recfg.ded_info_nas_list[i].data(), rx_recfg.ded_info_nas_list[i].size()); - nas_sdu->N_bytes = rx_recfg.ded_info_nas_list[i].size(); - rrc_ptr->nas->write_pdu(RB_ID_SRB1, std::move(nas_sdu)); - } else { - rrc_ptr->rrc_log->error("Fatal Error: Couldn't allocate PDU in %s.\n", __FUNCTION__); - return proc_outcome_t::error; - } - } - return proc_outcome_t::success; }