From dac331ab3829db75c08cc3987f1389d80ef5df2c Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Mon, 12 Apr 2021 22:48:45 +0200 Subject: [PATCH] Fix SR PUCCH resource flattening --- srsue/src/stack/rrc/rrc_nr.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/srsue/src/stack/rrc/rrc_nr.cc b/srsue/src/stack/rrc/rrc_nr.cc index 78c0e9c86..a42946ccd 100644 --- a/srsue/src/stack/rrc/rrc_nr.cc +++ b/srsue/src/stack/rrc/rrc_nr.cc @@ -842,6 +842,21 @@ bool rrc_nr::apply_sp_cell_ded_ul_pucch(const asn1::rrc_nr::pucch_cfg_s& pucch_c if (make_phy_sr_resource(pucch_cfg.sched_request_res_to_add_mod_list[i], &srsran_pucch_nr_sr_resource) == true) { // TODO: fix that if indexing is solved phy_cfg.pucch.sr_resources[res_id] = srsran_pucch_nr_sr_resource; + + // Set PUCCH resource + if (pucch_cfg.sched_request_res_to_add_mod_list[i].res_present) { + uint32_t pucch_res_id = pucch_cfg.sched_request_res_to_add_mod_list[i].res; + if (res_list_present[res_id]) { + phy_cfg.pucch.sr_resources[res_id].resource = res_list[pucch_res_id]; + } else { + logger.warning("Warning SR's PUCCH resource is invalid (%d)", pucch_res_id); + phy_cfg.pucch.sr_resources[res_id].configured = false; + } + } else { + logger.warning("Warning SR resource is present but no PUCCH resource is assigned to it"); + phy_cfg.pucch.sr_resources[res_id].configured = false; + } + } else { logger.warning("Warning while building srsran_pucch_nr_sr_resource structure"); return false;