From 925ac862cb2fa0258c91d84768a35b34655c2ccc Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Mon, 17 Feb 2020 20:18:29 +0000 Subject: [PATCH] sib acquiring is failing for sib2 --- srsue/hdr/stack/rrc/rrc.h | 17 ++++++++--------- srsue/src/stack/rrc/rrc.cc | 18 ++++++++++++++++++ srsue/src/stack/rrc/rrc_procedures.cc | 4 ++-- 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/srsue/hdr/stack/rrc/rrc.h b/srsue/hdr/stack/rrc/rrc.h index dcd5342c6..c8b9463b6 100644 --- a/srsue/hdr/stack/rrc/rrc.h +++ b/srsue/hdr/stack/rrc/rrc.h @@ -152,11 +152,7 @@ public: float get_rsrp() { return rsrp; } float get_rsrq() { return rsrq; } - void set_sib1(asn1::rrc::sib_type1_s* sib1_) - { - sib1 = *sib1_; - has_valid_sib1 = true; - } + void set_sib1(asn1::rrc::sib_type1_s* sib1_); void set_sib2(asn1::rrc::sib_type2_s* sib2_) { sib2 = *sib2_; @@ -259,6 +255,8 @@ public: return std::string{buf}; } + bool is_sib_scheduled(uint32_t sib_index) const; + phy_interface_rrc_lte::phy_cell_t phy_cell = {}; bool has_mcch = false; asn1::rrc::sib_type1_s sib1; @@ -273,10 +271,11 @@ private: struct timeval last_update = {}; - bool has_valid_sib1 = false; - bool has_valid_sib2 = false; - bool has_valid_sib3 = false; - bool has_valid_sib13 = false; + bool has_valid_sib1 = false; + bool has_valid_sib2 = false; + bool has_valid_sib3 = false; + bool has_valid_sib13 = false; + std::map sib_info_map; ///< map of sib_index to index of schedInfoList in SIB1 }; class rrc : public rrc_interface_nas, diff --git a/srsue/src/stack/rrc/rrc.cc b/srsue/src/stack/rrc/rrc.cc index 49f117d5e..f19ab2654 100644 --- a/srsue/src/stack/rrc/rrc.cc +++ b/srsue/src/stack/rrc/rrc.cc @@ -45,6 +45,24 @@ namespace srsue { const static uint32_t NOF_REQUIRED_SIBS = 4; const static uint32_t required_sibs[NOF_REQUIRED_SIBS] = {0, 1, 2, 12}; // SIB1, SIB2, SIB3 and SIB13 (eMBMS) +void cell_t::set_sib1(asn1::rrc::sib_type1_s* sib1_) +{ + sib1 = *sib1_; + has_valid_sib1 = true; + + sib_info_map.clear(); + for (uint32_t i = 0; i < sib1.sched_info_list.size(); ++i) { + for (uint32_t j = 0; j < sib1.sched_info_list[i].sib_map_info.size(); ++j) { + sib_info_map.insert(std::make_pair(sib1.sched_info_list[i].sib_map_info[j].to_number() - 1, i)); + } + } +} + +bool cell_t::is_sib_scheduled(uint32_t sib_index) const +{ + return sib_info_map.find(sib_index) != sib_info_map.end(); +} + /******************************************************************************* Base functions *******************************************************************************/ diff --git a/srsue/src/stack/rrc/rrc_procedures.cc b/srsue/src/stack/rrc/rrc_procedures.cc index a44cf91ed..6e067f797 100644 --- a/srsue/src/stack/rrc/rrc_procedures.cc +++ b/srsue/src/stack/rrc/rrc_procedures.cc @@ -379,8 +379,8 @@ srslte::proc_outcome_t rrc::serving_cell_config_proc::launch_sib_acquire() // Obtain the SIBs if not available or apply the configuration if available for (; req_idx < required_sibs.size(); req_idx++) { uint32_t required_sib = required_sibs[req_idx]; - - if (not rrc_ptr->serving_cell->has_sib(required_sib)) { + if (not rrc_ptr->serving_cell->has_sib(required_sib) and + (required_sib < 2 or rrc_ptr->serving_cell->is_sib_scheduled(required_sib))) { Info("Cell has no SIB%d. Obtaining SIB%d\n", required_sib + 1, required_sib + 1); if (not rrc_ptr->si_acquirer.launch(&si_acquire_fut, required_sib)) { Error("SI Acquire is already running...\n");