From be06f260db9aade7d710909eb77eb85bdd363d80 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Mon, 21 Jan 2019 16:39:00 +0000 Subject: [PATCH] fixed issues in the parsing of sibs --- srsenb/src/enb_cfg_parser.cc | 40 ++++++++++++++++++++++++++++-------- srsenb/src/enb_cfg_parser.h | 4 ++-- srsue/src/upper/rrc.cc | 2 +- 3 files changed, 35 insertions(+), 11 deletions(-) diff --git a/srsenb/src/enb_cfg_parser.cc b/srsenb/src/enb_cfg_parser.cc index b1cfc96df..67ef7025a 100644 --- a/srsenb/src/enb_cfg_parser.cc +++ b/srsenb/src/enb_cfg_parser.cc @@ -559,32 +559,56 @@ int mbsfn_area_info_list_parser::parse(Setting& root) field_asn1_enum_str fieldlen("non_mbsfn_region_length", &mbsfn_item->non_mbsfn_region_len); - fieldlen.parse(root["mbsfn_area_info_list"]); + if (fieldlen.parse(root["mbsfn_area_info_list"])) { + fprintf(stderr, "Error parsing non_mbsfn_region_length\n"); + return -1; + } field_asn1_enum_str repeat( "mcch_repetition_period", &mbsfn_item->mcch_cfg_r9.mcch_repeat_period_r9); - repeat.parse(root["mbsfn_area_info_list"]); + if (repeat.parse(root["mbsfn_area_info_list"])) { + fprintf(stderr, "Error parsing mcch_repetition_period\n"); + return -1; + } field_asn1_enum_str mod( "mcch_modification_period", &mbsfn_item->mcch_cfg_r9.mcch_mod_period_r9); - mod.parse(root["mbsfn_area_info_list"]); + if (mod.parse(root["mbsfn_area_info_list"])) { + fprintf(stderr, "Error parsing mcch_modification_period\n"); + return -1; + } field_asn1_enum_str sig("signalling_mcs", &mbsfn_item->mcch_cfg_r9.sig_mcs_r9); - sig.parse(root["mbsfn_area_info_list"]); + if (sig.parse(root["mbsfn_area_info_list"])) { + fprintf(stderr, "Error parsing signalling_mcs\n"); + return -1; + } parser::field areaid("mbsfn_area_id", &mbsfn_item->mbsfn_area_id_r9); - areaid.parse(root["mbsfn_area_info_list"]); + if (areaid.parse(root["mbsfn_area_info_list"])) { + fprintf(stderr, "Error parsing mbsfn_area_id\n"); + return -1; + } parser::field notif_ind("notification_indicator", &mbsfn_item->notif_ind_r9); - notif_ind.parse(root["mbsfn_area_info_list"]); + if (notif_ind.parse(root["mbsfn_area_info_list"])) { + fprintf(stderr, "Error parsing notification_indicator\n"); + return -1; + } parser::field offset("mcch_offset", &mbsfn_item->mcch_cfg_r9.mcch_offset_r9); - offset.parse(root["mbsfn_area_info_list"]); + if (offset.parse(root["mbsfn_area_info_list"])) { + fprintf(stderr, "Error parsing mcch_offset\n"); + return -1; + } field_asn1_bitstring_number, uint8_t> alloc_info("sf_alloc_info", &mbsfn_item->mcch_cfg_r9.sf_alloc_info_r9); - alloc_info.parse(root["mbsfn_area_info_list"]); + if (alloc_info.parse(root["mbsfn_area_info_list"])) { + fprintf(stderr, "Error parsing mbsfn_area_info_list\n"); + return -1; + } return 0; } diff --git a/srsenb/src/enb_cfg_parser.h b/srsenb/src/enb_cfg_parser.h index ba6d0d05d..a87a9f330 100644 --- a/srsenb/src/enb_cfg_parser.h +++ b/srsenb/src/enb_cfg_parser.h @@ -475,7 +475,7 @@ public: NumType val; if (parser::lookupValue(root, name, &val)) { store_ptr->from_number(val); - return true; + return 0; } else { std::string str_val; if (parser::lookupValue(root, name, &str_val)) { @@ -483,7 +483,7 @@ public: str_val.c_str()); } } - return false; + return -1; } }; diff --git a/srsue/src/upper/rrc.cc b/srsue/src/upper/rrc.cc index 1edf6aedf..e1c9c996f 100644 --- a/srsue/src/upper/rrc.cc +++ b/srsue/src/upper/rrc.cc @@ -739,7 +739,7 @@ bool rrc::si_acquire(uint32_t sib_index) bool found = false; for (uint32_t i = 0; i < sib1->sched_info_list.size() && !found; i++) { for (uint32_t j = 0; j < sib1->sched_info_list[i].sib_map_info.size() && !found; j++) { - if (sib1->sched_info_list[i].sib_map_info[j].to_number() == sib_index - 2) { + if (sib1->sched_info_list[i].sib_map_info[j].to_number() == sib_index + 1) { period = sib1->sched_info_list[i].si_periodicity.to_number(); sched_index = i; found = true;