fixed issues in the parsing of sibs

master
Francisco Paisana 6 years ago
parent 840b9ce364
commit be06f260db

@ -559,32 +559,56 @@ int mbsfn_area_info_list_parser::parse(Setting& root)
field_asn1_enum_str<mbsfn_area_info_r9_s::non_mbsfn_region_len_e_> fieldlen("non_mbsfn_region_length", field_asn1_enum_str<mbsfn_area_info_r9_s::non_mbsfn_region_len_e_> fieldlen("non_mbsfn_region_length",
&mbsfn_item->non_mbsfn_region_len); &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<mbsfn_area_info_r9_s::mcch_cfg_r9_s_::mcch_repeat_period_r9_e_> repeat( field_asn1_enum_str<mbsfn_area_info_r9_s::mcch_cfg_r9_s_::mcch_repeat_period_r9_e_> repeat(
"mcch_repetition_period", &mbsfn_item->mcch_cfg_r9.mcch_repeat_period_r9); "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<mbsfn_area_info_r9_s::mcch_cfg_r9_s_::mcch_mod_period_r9_e_> mod( field_asn1_enum_str<mbsfn_area_info_r9_s::mcch_cfg_r9_s_::mcch_mod_period_r9_e_> mod(
"mcch_modification_period", &mbsfn_item->mcch_cfg_r9.mcch_mod_period_r9); "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<mbsfn_area_info_r9_s::mcch_cfg_r9_s_::sig_mcs_r9_e_> sig("signalling_mcs", field_asn1_enum_str<mbsfn_area_info_r9_s::mcch_cfg_r9_s_::sig_mcs_r9_e_> sig("signalling_mcs",
&mbsfn_item->mcch_cfg_r9.sig_mcs_r9); &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<uint8_t> areaid("mbsfn_area_id", &mbsfn_item->mbsfn_area_id_r9); parser::field<uint8_t> 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<uint8_t> notif_ind("notification_indicator", &mbsfn_item->notif_ind_r9); parser::field<uint8_t> 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<uint8_t> offset("mcch_offset", &mbsfn_item->mcch_cfg_r9.mcch_offset_r9); parser::field<uint8_t> 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<asn1::fixed_bitstring<6>, uint8_t> alloc_info("sf_alloc_info", field_asn1_bitstring_number<asn1::fixed_bitstring<6>, uint8_t> alloc_info("sf_alloc_info",
&mbsfn_item->mcch_cfg_r9.sf_alloc_info_r9); &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; return 0;
} }

@ -475,7 +475,7 @@ public:
NumType val; NumType val;
if (parser::lookupValue(root, name, &val)) { if (parser::lookupValue(root, name, &val)) {
store_ptr->from_number(val); store_ptr->from_number(val);
return true; return 0;
} else { } else {
std::string str_val; std::string str_val;
if (parser::lookupValue(root, name, &str_val)) { if (parser::lookupValue(root, name, &str_val)) {
@ -483,7 +483,7 @@ public:
str_val.c_str()); str_val.c_str());
} }
} }
return false; return -1;
} }
}; };

@ -739,7 +739,7 @@ bool rrc::si_acquire(uint32_t sib_index)
bool found = false; bool found = false;
for (uint32_t i = 0; i < sib1->sched_info_list.size() && !found; i++) { 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++) { 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(); period = sib1->sched_info_list[i].si_periodicity.to_number();
sched_index = i; sched_index = i;
found = true; found = true;

Loading…
Cancel
Save