From 67690136be2bd8a1e26dd6aeab56dec9a7ec1b4a Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Tue, 10 Nov 2020 13:10:42 +0100 Subject: [PATCH] Select strongest cell after cell search (#2001) * Select strongest cell in all frequencies when * Change variable name --- srsue/src/stack/rrc/rrc_procedures.cc | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/srsue/src/stack/rrc/rrc_procedures.cc b/srsue/src/stack/rrc/rrc_procedures.cc index fe07c1623..1acda0076 100644 --- a/srsue/src/stack/rrc/rrc_procedures.cc +++ b/srsue/src/stack/rrc/rrc_procedures.cc @@ -505,17 +505,15 @@ proc_outcome_t rrc::cell_selection_proc::init(std::vector required_sib required_sibs.insert(required_sibs.end(), mandatory_sibs.begin(), mandatory_sibs.end()); init_serv_cell = meas_cells->serving_cell().phy_cell; - // Check if there are sronger neighbors in same EARFCN + // Check if there are stronger neighbors in any EARFCN const sib_type3_s* sib3 = meas_cells->serving_cell().sib3ptr(); - uint32_t threshold = sib3 != nullptr ? sib3->cell_resel_serving_freq_info.thresh_serving_low * 2 : 5; - bool stronger_neigh_in_earfcn = - std::any_of(meas_cells->begin(), meas_cells->end(), [this, threshold](const unique_cell_t& c) { - return meas_cells->serving_cell().get_earfcn() == c->get_earfcn() and std::isnormal(c->get_rsrp()) and - meas_cells->serving_cell().get_rsrp() + threshold < c->get_rsrp(); - }); + uint32_t threshold = sib3 != nullptr ? sib3->cell_resel_serving_freq_info.thresh_serving_low * 2 : 3; + bool stronger_neigh = std::any_of(meas_cells->begin(), meas_cells->end(), [this, threshold](const unique_cell_t& c) { + return std::isnormal(c->get_rsrp()) and meas_cells->serving_cell().get_rsrp() + threshold < c->get_rsrp(); + }); // Skip cell selection if serving cell is suitable and there are no stronger neighbours in same earfcn - if (is_serv_cell_suitable() and not stronger_neigh_in_earfcn) { + if (is_serv_cell_suitable() and not stronger_neigh) { Debug("Skipping cell selection procedure as there are no stronger neighbours in same EARFCN.\n"); return set_proc_complete(); } @@ -535,7 +533,7 @@ proc_outcome_t rrc::cell_selection_proc::init(std::vector required_sib neigh_index = 0; cs_result = cs_result_t::no_cell; discard_serving = false; - serv_cell_select_attempted = stronger_neigh_in_earfcn; + serv_cell_select_attempted = stronger_neigh; cell_search_called = false; state = search_state_t::cell_selection; return start_next_cell_selection();