diff --git a/srsenb/src/enb_cfg_parser.cc b/srsenb/src/enb_cfg_parser.cc index b4a4e67fb..0e4771e9f 100644 --- a/srsenb/src/enb_cfg_parser.cc +++ b/srsenb/src/enb_cfg_parser.cc @@ -210,38 +210,38 @@ int enb::parse_sib2(std::string filename, LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_2_STRUC ("time_alignment_timer", &data->time_alignment_timer, liblte_rrc_time_alignment_timer_text, LIBLTE_RRC_TIME_ALIGNMENT_TIMER_N_ITEMS) ); - - - sib2.add_field( + + parser::section mbsfnSubframeConfigList("mbsfnSubframeConfigList"); + sib2.add_subsection(&mbsfnSubframeConfigList); + + bool mbsfn_present=false; + mbsfnSubframeConfigList.set_optional(&mbsfn_present); + + if (mbsfn_present) { + data->mbsfn_subfr_cnfg_list_size = 1; + } + + mbsfnSubframeConfigList.add_field( new parser::field - ("mbsfnSubframeConfigListLength", &data->mbsfn_subfr_cnfg_list_size) + ("subframeAllocation", &data->mbsfn_subfr_cnfg_list[0].subfr_alloc) + ); + + mbsfnSubframeConfigList.add_field( + new parser::field + ("radioframeAllocationOffset", &data->mbsfn_subfr_cnfg_list[0].radio_fr_alloc_offset) + ); + + mbsfnSubframeConfigList.add_field( + new parser::field_enum_str + ("subframeAllocationNumFrames", &data->mbsfn_subfr_cnfg_list[0].subfr_alloc_num_frames, + liblte_rrc_subframe_allocation_num_frames_text,LIBLTE_RRC_SUBFRAME_ALLOCATION_NUM_FRAMES_N_ITEMS) + ); + + mbsfnSubframeConfigList.add_field( + new parser::field_enum_str + ("radioframeAllocationPeriod", &data->mbsfn_subfr_cnfg_list[0].radio_fr_alloc_period, + liblte_rrc_radio_frame_allocation_period_text, LIBLTE_RRC_RADIO_FRAME_ALLOCATION_PERIOD_N_ITEMS) ); - - - parser::section mbsfnSubframeConfigList("mbsfnSubframeConfigList"); - sib2.add_subsection(&mbsfnSubframeConfigList); - - mbsfnSubframeConfigList.add_field( - new parser::field - ("subframeAllocation", &data->mbsfn_subfr_cnfg_list[0].subfr_alloc) - ); - - mbsfnSubframeConfigList.add_field( - new parser::field - ("radioframeAllocationOffset", &data->mbsfn_subfr_cnfg_list[0].radio_fr_alloc_offset) - ); - - mbsfnSubframeConfigList.add_field( - new parser::field_enum_str - ("subframeAllocationNumFrames", &data->mbsfn_subfr_cnfg_list[0].subfr_alloc_num_frames, - liblte_rrc_subframe_allocation_num_frames_text,LIBLTE_RRC_SUBFRAME_ALLOCATION_NUM_FRAMES_N_ITEMS) - ); - - mbsfnSubframeConfigList.add_field( - new parser::field_enum_str - ("radioframeAllocationPeriod", &data->mbsfn_subfr_cnfg_list[0].radio_fr_alloc_period, - liblte_rrc_radio_frame_allocation_period_text, LIBLTE_RRC_RADIO_FRAME_ALLOCATION_PERIOD_N_ITEMS) - ); parser::section freqinfo("freqInfo"); sib2.add_subsection(&freqinfo);