diff --git a/lib/include/srsran/asn1/rrc_nr_utils.h b/lib/include/srsran/asn1/rrc_nr_utils.h index 04477dd80..d732aa57a 100644 --- a/lib/include/srsran/asn1/rrc_nr_utils.h +++ b/lib/include/srsran/asn1/rrc_nr_utils.h @@ -116,6 +116,8 @@ bool make_phy_ssb_cfg(const srsran_carrier_nr_t& carrier, phy_cfg_nr_t::ssb_cfg_t* ssb); bool make_pdsch_cfg_from_serv_cell(const asn1::rrc_nr::serving_cell_cfg_s& serv_cell, srsran_sch_hl_cfg_nr_t* sch_hl); bool make_csi_cfg_from_serv_cell(const asn1::rrc_nr::serving_cell_cfg_s& serv_cell, srsran_csi_hl_cfg_t* csi_hl); +bool make_duplex_cfg_from_serv_cell(const asn1::rrc_nr::serving_cell_cfg_common_s& serv_cell, + srsran_duplex_config_nr_t* duplex_cfg); /*************************** * MAC Config diff --git a/lib/src/asn1/rrc_nr_utils.cc b/lib/src/asn1/rrc_nr_utils.cc index 751f8e3a5..12964a225 100644 --- a/lib/src/asn1/rrc_nr_utils.cc +++ b/lib/src/asn1/rrc_nr_utils.cc @@ -1539,6 +1539,18 @@ bool make_csi_cfg_from_serv_cell(const asn1::rrc_nr::serving_cell_cfg_s& serv_ce return true; } +bool make_duplex_cfg_from_serv_cell(const asn1::rrc_nr::serving_cell_cfg_common_s& serv_cell, + srsran_duplex_config_nr_t* duplex_cfg) +{ + duplex_cfg->mode = serv_cell.tdd_ul_dl_cfg_common_present ? SRSRAN_DUPLEX_MODE_TDD : SRSRAN_DUPLEX_MODE_FDD; + if (serv_cell.tdd_ul_dl_cfg_common_present) { + if (not make_phy_tdd_cfg(serv_cell.tdd_ul_dl_cfg_common, duplex_cfg)) { + return false; + } + } + return true; +} + } // namespace srsran namespace srsenb { diff --git a/srsenb/src/stack/rrc/rrc_nr.cc b/srsenb/src/stack/rrc/rrc_nr.cc index 4c206ae87..567249067 100644 --- a/srsenb/src/stack/rrc/rrc_nr.cc +++ b/srsenb/src/stack/rrc/rrc_nr.cc @@ -254,6 +254,8 @@ void rrc_nr::config_mac() ret2 = srsran::make_phy_ssb_cfg( cfg.cell_list[0].phy_cell.carrier, sp_cell.recfg_with_sync.sp_cell_cfg_common, &cell.ssb); srsran_assert(ret2, "Invalid NR cell configuration."); + ret2 = srsran::make_duplex_cfg_from_serv_cell(sp_cell.recfg_with_sync.sp_cell_cfg_common, &cell.duplex); + srsran_assert(ret2, "Invalid NR cell configuration."); // FIXME: entire SI configuration, etc needs to be ported to NR sched_interface::cell_cfg_t cell_cfg; @@ -1401,6 +1403,8 @@ void rrc_nr::ue::crnti_ce_received() srsran::make_phy_ssb_cfg(parent->cfg.cell_list[0].phy_cell.carrier, cell_group_cfg.sp_cell_cfg.recfg_with_sync.sp_cell_cfg_common, &uecfg.phy_cfg.ssb); + srsran::make_duplex_cfg_from_serv_cell(cell_group_cfg.sp_cell_cfg.recfg_with_sync.sp_cell_cfg_common, + &uecfg.phy_cfg.duplex); parent->mac->ue_cfg(rnti, uecfg); }