diff --git a/lib/include/srsran/interfaces/enb_rrc_interface_types.h b/lib/include/srsran/interfaces/enb_rrc_interface_types.h index 443c873f0..998dfc8ea 100644 --- a/lib/include/srsran/interfaces/enb_rrc_interface_types.h +++ b/lib/include/srsran/interfaces/enb_rrc_interface_types.h @@ -28,12 +28,12 @@ struct scell_cfg_t { // Cell to measure for Handover struct meas_cell_cfg_t { - uint32_t earfcn; - uint16_t pci; - uint32_t eci; - float q_offset; - uint32_t allowed_meas_bw; - bool direct_forward_path_available; + uint32_t earfcn; + uint16_t pci; + uint32_t eci; + asn1::rrc::q_offset_range_e cell_individual_offset; + uint32_t allowed_meas_bw; + bool direct_forward_path_available; }; // neigh measurement Cell info diff --git a/srsenb/rr.conf.example b/srsenb/rr.conf.example index e5d6fd02c..78b2df154 100644 --- a/srsenb/rr.conf.example +++ b/srsenb/rr.conf.example @@ -84,6 +84,7 @@ cell_list = pci = 2; //direct_forward_path_available = false; //allowed_meas_bw = 6; + //cell_individual_offset = 0; } ); diff --git a/srsenb/src/enb_cfg_parser.cc b/srsenb/src/enb_cfg_parser.cc index 1bcd57b4c..2897f333e 100644 --- a/srsenb/src/enb_cfg_parser.cc +++ b/srsenb/src/enb_cfg_parser.cc @@ -767,13 +767,14 @@ static int parse_meas_cell_list(rrc_meas_cfg_t* meas_cfg, Setting& root) { meas_cfg->meas_cells.resize(root.getLength()); for (uint32_t i = 0; i < meas_cfg->meas_cells.size(); ++i) { - auto& cell = meas_cfg->meas_cells[i]; - cell.earfcn = root[i]["dl_earfcn"]; - cell.pci = (unsigned int)root[i]["pci"] % SRSRAN_NUM_PCI; - cell.eci = (unsigned int)root[i]["eci"]; - cell.q_offset = 0; // LIBLTE_RRC_Q_OFFSET_RANGE_DB_0; // TODO + auto& cell = meas_cfg->meas_cells[i]; + cell.earfcn = root[i]["dl_earfcn"]; + cell.pci = (unsigned int)root[i]["pci"] % SRSRAN_NUM_PCI; + cell.eci = (unsigned int)root[i]["eci"]; parse_default_field(cell.direct_forward_path_available, root[i], "direct_forward_path_available", false); parse_default_field(cell.allowed_meas_bw, root[i], "allowed_meas_bw", 6u); + asn1_parsers::default_number_to_enum( + cell.cell_individual_offset, root[i], "cell_individual_offset", asn1::rrc::q_offset_range_opts::db0); srsran_assert(srsran::is_lte_cell_nof_prb(cell.allowed_meas_bw), "Invalid measurement Bandwidth"); } return 0; diff --git a/srsenb/src/stack/rrc/ue_meas_cfg.cc b/srsenb/src/stack/rrc/ue_meas_cfg.cc index 7a30949eb..f5fc06d4a 100644 --- a/srsenb/src/stack/rrc/ue_meas_cfg.cc +++ b/srsenb/src/stack/rrc/ue_meas_cfg.cc @@ -84,8 +84,8 @@ std::tuple add_cell_enb_cfg(meas_obj_lis bool inserted_flag = true; cells_to_add_mod_s new_cell; - asn1::number_to_enum(new_cell.cell_individual_offset, (uint8_t)cellcfg.q_offset); - new_cell.pci = cellcfg.pci; + new_cell.cell_individual_offset = cellcfg.cell_individual_offset; + new_cell.pci = cellcfg.pci; std::pair ret = find_cell(meas_obj_list, cellcfg.earfcn, cellcfg.pci); diff --git a/srsenb/test/rrc/rrc_meascfg_test.cc b/srsenb/test/rrc/rrc_meascfg_test.cc index 69f9b0cb5..2443946c2 100644 --- a/srsenb/test/rrc/rrc_meascfg_test.cc +++ b/srsenb/test/rrc/rrc_meascfg_test.cc @@ -31,14 +31,14 @@ namespace srsenb { */ int test_correct_meascfg_insertion() { - meas_cell_cfg_t cell1 = generate_cell1(), cell2{}, cell3{}, cell4{}; - cell2 = cell1; - cell2.pci = 2; - cell2.eci = 0x19C02; - cell3 = cell1; - cell3.earfcn = 2850; - cell4 = cell1; - cell4.q_offset = 1; + meas_cell_cfg_t cell1 = generate_cell1(), cell2{}, cell3{}, cell4{}; + cell2 = cell1; + cell2.pci = 2; + cell2.eci = 0x19C02; + cell3 = cell1; + cell3.earfcn = 2850; + cell4 = cell1; + cell1.cell_individual_offset = asn1::rrc::q_offset_range_opts::db1; report_cfg_eutra_s rep1 = generate_rep1(); @@ -108,13 +108,13 @@ int test_correct_meascfg_calculation() meas_cfg_s src_var{}, target_var{}; meas_cell_cfg_t cell1{}, cell2{}; - cell1.earfcn = 3400; - cell1.pci = 1; - cell1.q_offset = 0; - cell1.eci = 0x19C01; - cell2 = cell1; - cell2.pci = 2; - cell2.eci = 0x19C02; + cell1.earfcn = 3400; + cell1.pci = 1; + cell1.cell_individual_offset = asn1::rrc::q_offset_range_opts::db0; + cell1.eci = 0x19C01; + cell2 = cell1; + cell2.pci = 2; + cell2.eci = 0x19C02; report_cfg_eutra_s rep1 = generate_rep1(), rep2{}, rep3{}; rep2 = rep1; @@ -169,8 +169,8 @@ int test_correct_meascfg_calculation() TESTASSERT(result_meascfg.report_cfg_to_add_mod_list.size() == 0); // TEST 3: Cell is added to cellsToAddModList if just a field was updated - cell1.q_offset = 5; - src_var = target_var; + cell1.cell_individual_offset = asn1::rrc::q_offset_range_opts::db5; + src_var = target_var; add_cell_enb_cfg(target_var.meas_obj_to_add_mod_list, cell1); TESTASSERT(compute_diff_meascfg(src_var, target_var, result_meascfg)); TESTASSERT(result_meascfg.meas_obj_to_add_mod_list_present); diff --git a/srsenb/test/rrc/test_helpers.cc b/srsenb/test/rrc/test_helpers.cc index 0af028974..e9756c188 100644 --- a/srsenb/test/rrc/test_helpers.cc +++ b/srsenb/test/rrc/test_helpers.cc @@ -173,10 +173,10 @@ namespace srsenb { meas_cell_cfg_t generate_cell1() { meas_cell_cfg_t cell1{}; - cell1.earfcn = 3400; - cell1.pci = 1; - cell1.q_offset = 0; - cell1.eci = 0x19C01; + cell1.earfcn = 3400; + cell1.pci = 1; + cell1.cell_individual_offset = asn1::rrc::q_offset_range_opts::db0; + cell1.eci = 0x19C01; return cell1; } @@ -198,7 +198,7 @@ report_cfg_eutra_s generate_rep1() bool is_cell_cfg_equal(const meas_cell_cfg_t& cfg, const cells_to_add_mod_s& cell) { - return cfg.pci == cell.pci and cell.cell_individual_offset.to_number() == (int8_t)round(cfg.q_offset); + return cfg.pci == cell.pci and cell.cell_individual_offset == cell.cell_individual_offset; } } // namespace srsenb