From af73c57780a9bc158f004c5f3debaf19c7b41ae1 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Wed, 22 Sep 2021 17:00:25 +0200 Subject: [PATCH] rrc_endc: prepare ENDC paramter exposes some of the hard-coded params as struct. filling/parsing from file still needs to be added. --- srsenb/hdr/stack/rrc/rrc_endc.h | 12 ++++++++- srsenb/src/stack/rrc/rrc_endc.cc | 42 ++++++++++++++------------------ srsenb/src/stack/rrc/rrc_ue.cc | 3 ++- 3 files changed, 31 insertions(+), 26 deletions(-) diff --git a/srsenb/hdr/stack/rrc/rrc_endc.h b/srsenb/hdr/stack/rrc/rrc_endc.h index 842367d88..c5d747cf1 100644 --- a/srsenb/hdr/stack/rrc/rrc_endc.h +++ b/srsenb/hdr/stack/rrc/rrc_endc.h @@ -48,7 +48,16 @@ public: uint16_t nr_rnti; /// RNTI assigned to UE on NR carrier }; - rrc_endc(srsenb::rrc::ue* outer_ue); + // Parameter of the (NR)-carrier required for NR cell measurement handling + struct rrc_endc_cfg_t { + bool act_from_b1_event = true; // ENDC will only be activated from B1 measurment + uint32_t nr_dl_arfcn = 634176; + uint32_t nr_band = 78; + asn1::rrc::rs_cfg_ssb_nr_r15_s::subcarrier_spacing_ssb_r15_e_ ssb_ssc = + asn1::rrc::rs_cfg_ssb_nr_r15_s::subcarrier_spacing_ssb_r15_opts::khz15; + }; + + rrc_endc(srsenb::rrc::ue* outer_ue, const rrc_endc_cfg_t& endc_cfg_); bool fill_conn_recfg(asn1::rrc::rrc_conn_recfg_r8_ies_s* conn_recfg); void handle_eutra_capabilities(const asn1::rrc::ue_eutra_cap_s& eutra_caps); @@ -68,6 +77,7 @@ private: // vars bool endc_supported = false; + rrc_endc_cfg_t endc_cfg = {}; asn1::rrc::rrc_conn_recfg_complete_s pending_recfg_complete; // fixed ENDC variables diff --git a/srsenb/src/stack/rrc/rrc_endc.cc b/srsenb/src/stack/rrc/rrc_endc.cc index e9465a1e3..d3d812f94 100644 --- a/srsenb/src/stack/rrc/rrc_endc.cc +++ b/srsenb/src/stack/rrc/rrc_endc.cc @@ -29,8 +29,12 @@ using namespace asn1::rrc; * rrc_endc class ************************************************************************************************/ -rrc::ue::rrc_endc::rrc_endc(rrc::ue* outer_ue) : - base_t(outer_ue->parent->logger), rrc_ue(outer_ue), rrc_enb(outer_ue->parent), logger(outer_ue->parent->logger) +rrc::ue::rrc_endc::rrc_endc(rrc::ue* outer_ue, const rrc_endc_cfg_t& endc_cfg_) : + base_t(outer_ue->parent->logger), + rrc_ue(outer_ue), + rrc_enb(outer_ue->parent), + logger(outer_ue->parent->logger), + endc_cfg(endc_cfg_) {} //! Method to add NR fields to a RRC Connection Reconfiguration Message @@ -41,7 +45,7 @@ bool rrc::ue::rrc_endc::fill_conn_recfg(asn1::rrc::rrc_conn_recfg_r8_ies_s* conn return false; } - if (not is_endc_activation_running()) { + if (not is_endc_activation_running() && endc_cfg.act_from_b1_event) { // add hard-coded measConfig conn_recfg->meas_cfg_present = true; meas_cfg_s& meas_cfg = conn_recfg->meas_cfg; @@ -50,26 +54,16 @@ bool rrc::ue::rrc_endc::fill_conn_recfg(asn1::rrc::rrc_conn_recfg_r8_ies_s* conn meas_obj_to_add_mod_s meas_obj = {}; meas_obj.meas_obj_id = meas_cfg.meas_obj_to_add_mod_list.size() + 1; - meas_obj.meas_obj.set_meas_obj_eutra(); - meas_obj.meas_obj.meas_obj_eutra().carrier_freq = 300; - meas_obj.meas_obj.meas_obj_eutra().allowed_meas_bw = allowed_meas_bw_opts::mbw50; - meas_obj.meas_obj.meas_obj_eutra().presence_ant_port1 = false; - meas_obj.meas_obj.meas_obj_eutra().neigh_cell_cfg.from_number(0b01); - meas_cfg.meas_obj_to_add_mod_list.push_back(meas_obj); - - meas_obj_to_add_mod_s meas_obj2 = {}; - meas_obj2.meas_obj_id = meas_cfg.meas_obj_to_add_mod_list.size() + 1; - meas_obj2.meas_obj.set_meas_obj_nr_r15(); - meas_obj2.meas_obj.meas_obj_nr_r15().carrier_freq_r15 = 634176; - meas_obj2.meas_obj.meas_obj_nr_r15().rs_cfg_ssb_r15.meas_timing_cfg_r15.periodicity_and_offset_r15.set_sf20_r15(); - meas_obj2.meas_obj.meas_obj_nr_r15().rs_cfg_ssb_r15.meas_timing_cfg_r15.ssb_dur_r15 = + meas_obj.meas_obj.set_meas_obj_nr_r15(); + meas_obj.meas_obj.meas_obj_nr_r15().carrier_freq_r15 = endc_cfg.nr_dl_arfcn; + meas_obj.meas_obj.meas_obj_nr_r15().rs_cfg_ssb_r15.meas_timing_cfg_r15.periodicity_and_offset_r15.set_sf20_r15(); + meas_obj.meas_obj.meas_obj_nr_r15().rs_cfg_ssb_r15.meas_timing_cfg_r15.ssb_dur_r15 = asn1::rrc::mtc_ssb_nr_r15_s::ssb_dur_r15_opts::sf1; - meas_obj2.meas_obj.meas_obj_nr_r15().rs_cfg_ssb_r15.subcarrier_spacing_ssb_r15 = - asn1::rrc::rs_cfg_ssb_nr_r15_s::subcarrier_spacing_ssb_r15_opts::khz30; - meas_obj2.meas_obj.meas_obj_nr_r15().ext = true; - meas_obj2.meas_obj.meas_obj_nr_r15().band_nr_r15.set_present(true); - meas_obj2.meas_obj.meas_obj_nr_r15().band_nr_r15.get()->set_setup() = 78; - meas_cfg.meas_obj_to_add_mod_list.push_back(meas_obj2); + meas_obj.meas_obj.meas_obj_nr_r15().rs_cfg_ssb_r15.subcarrier_spacing_ssb_r15 = endc_cfg.ssb_ssc; + meas_obj.meas_obj.meas_obj_nr_r15().ext = true; + meas_obj.meas_obj.meas_obj_nr_r15().band_nr_r15.set_present(true); + meas_obj.meas_obj.meas_obj_nr_r15().band_nr_r15.get()->set_setup() = endc_cfg.nr_band; + meas_cfg.meas_obj_to_add_mod_list.push_back(meas_obj); // report config meas_cfg.report_cfg_to_add_mod_list_present = true; @@ -105,8 +99,8 @@ bool rrc::ue::rrc_endc::fill_conn_recfg(asn1::rrc::rrc_conn_recfg_r8_ies_s* conn // measIdToAddModList meas_cfg.meas_id_to_add_mod_list_present = true; meas_id_to_add_mod_s meas_id = {}; - meas_id.meas_id = meas_obj.meas_obj_id; - meas_id.meas_obj_id = meas_obj2.meas_obj_id; + meas_id.meas_id = meas_cfg.meas_id_to_add_mod_list.size() + 1; + meas_id.meas_obj_id = meas_obj.meas_obj_id; meas_id.report_cfg_id = report_cfg.report_cfg_id; meas_cfg.meas_id_to_add_mod_list.push_back(meas_id); diff --git a/srsenb/src/stack/rrc/rrc_ue.cc b/srsenb/src/stack/rrc/rrc_ue.cc index b087727a4..6714e07e8 100644 --- a/srsenb/src/stack/rrc/rrc_ue.cc +++ b/srsenb/src/stack/rrc/rrc_ue.cc @@ -87,7 +87,8 @@ int rrc::ue::init() mobility_handler = make_rnti_obj(rnti, this); if (parent->rrc_nr != nullptr) { - endc_handler = make_rnti_obj(rnti, this); + rrc::ue::rrc_endc::rrc_endc_cfg_t endc_cfg = {}; // TODO: set or derive parameter in eNB config + endc_handler = make_rnti_obj(rnti, this, endc_cfg); } return SRSRAN_SUCCESS;