From 248583ecdfea2b95772b7447f1d9d1ce11e93208 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Mon, 21 Oct 2019 20:00:02 +0100 Subject: [PATCH] added extra logging and removed uneeded member from proc_t --- lib/include/srslte/common/stack_procedure.h | 20 +++++++++----------- srsue/src/stack/rrc/rrc_procedures.cc | 11 ++++++----- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/lib/include/srslte/common/stack_procedure.h b/lib/include/srslte/common/stack_procedure.h index d062a365f..7fdcbea7c 100644 --- a/lib/include/srslte/common/stack_procedure.h +++ b/lib/include/srslte/common/stack_procedure.h @@ -306,7 +306,7 @@ public: proc_future_type get_future() { if (future_result == nullptr) { - future_result = std::make_shared(proc_result); + future_result = std::make_shared(); } return proc_future_type{future_result}; } @@ -342,30 +342,28 @@ protected: void run_then(bool is_success) final { + proc_result_type result; // update result state if (is_success) { - proc_result.extract_val(*proc_ptr); + result.extract_val(*proc_ptr); } else { - proc_result.set_error(); + result.set_error(); } - // call T::then() if it exists - proc_detail::optional_then(proc_ptr.get(), proc_result); - // signal continuations - complete_callbacks(proc_result); // propagate proc_result to future if it exists, and release future if (future_result != nullptr) { - *future_result = proc_result; + *future_result = result; future_result.reset(); } - // reset the current result, to prepare it for a new run. - proc_result.clear(); + // call T::then() if it exists + proc_detail::optional_then(proc_ptr.get(), result); + // signal continuations + complete_callbacks(result); // back to inactive proc_detail::optional_clear(proc_ptr.get()); proc_state = proc_status_t::idle; } std::unique_ptr proc_ptr; - proc_result_type proc_result; std::shared_ptr future_result; //! used if get_future() itf is used. then_callback_list_t complete_callbacks; }; diff --git a/srsue/src/stack/rrc/rrc_procedures.cc b/srsue/src/stack/rrc/rrc_procedures.cc index debcf9640..d7ca2cd57 100644 --- a/srsue/src/stack/rrc/rrc_procedures.cc +++ b/srsue/src/stack/rrc/rrc_procedures.cc @@ -333,6 +333,7 @@ proc_outcome_t rrc::cell_selection_proc::init() if (rrc_ptr->neighbour_cells.empty() and rrc_ptr->serving_cell->in_sync and rrc_ptr->phy->cell_is_camping()) { // don't bother with cell selection if there are no neighbours and we are already camping Debug("Skipping Cell Selection Procedure ..\n"); + cs_result = cs_result_t::same_cell; return proc_outcome_t::success; } @@ -825,12 +826,11 @@ proc_outcome_t rrc::go_idle_proc::step() * Cell Reselection procedure *************************************/ -rrc::cell_reselection_proc::cell_reselection_proc(srsue::rrc* rrc_) - : rrc_ptr(rrc_) {} +rrc::cell_reselection_proc::cell_reselection_proc(srsue::rrc* rrc_) : rrc_ptr(rrc_) {} proc_outcome_t rrc::cell_reselection_proc::init() { - Info("Cell Reselection - Starting...\n"); + Info("Starting...\n"); if (not rrc_ptr->cell_selector.launch()) { Error("Failed to initiate a Cell Selection procedure...\n"); return proc_outcome_t::error; @@ -846,13 +846,14 @@ proc_outcome_t rrc::cell_reselection_proc::step() return srslte::proc_outcome_t::yield; } if (cell_selection_fut.is_error()) { - Error("Cell Reselection - Error while selecting a cell\n"); + Error("Error while selecting a cell\n"); return srslte::proc_outcome_t::error; } + Info("Cell Selection completed. Handling its result...\n"); switch (*cell_selection_fut.value()) { case cs_result_t::changed_cell: - // New cell has been selected, start receiving PCCH + Info("New cell has been selected, start receiving PCCH\n"); rrc_ptr->mac->pcch_start_rx(); break; case cs_result_t::no_cell: