From ed179fd3110d18cc46991f20b6168bfb5ec8a426 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Thu, 6 Feb 2020 11:50:57 +0100 Subject: [PATCH] timers: rename value() to time_elapsed() this seems to be better readable than value() since we've sometimes confused it with the timeout value --- lib/include/srslte/common/timers.h | 4 ++-- lib/src/upper/rlc_am_lte.cc | 2 +- lib/test/common/timer_test.cc | 2 +- srsenb/src/stack/rrc/rrc.cc | 3 ++- srsue/src/stack/mac/demux.cc | 6 ++++-- srsue/src/stack/rrc/rrc_procedures.cc | 4 ++-- 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/include/srslte/common/timers.h b/lib/include/srslte/common/timers.h index a969c67bd..7f455c9de 100644 --- a/lib/include/srslte/common/timers.h +++ b/lib/include/srslte/common/timers.h @@ -69,7 +69,7 @@ class timer_handler bool is_expired() const { return active and not running and timeout > 0 and timeout <= parent->cur_time; } - uint32_t value() const { return std::min(duration, parent->cur_time - (timeout - duration)); } + uint32_t time_elapsed() const { return std::min(duration, parent->cur_time - (timeout - duration)); } bool set(uint32_t duration_) { @@ -184,7 +184,7 @@ public: bool is_expired() const { return impl()->is_expired(); } - uint32_t value() const { return impl()->value(); } + uint32_t time_elapsed() const { return impl()->time_elapsed(); } void run() { impl()->run(); } diff --git a/lib/src/upper/rlc_am_lte.cc b/lib/src/upper/rlc_am_lte.cc index 5b2213b8e..62de8ec31 100644 --- a/lib/src/upper/rlc_am_lte.cc +++ b/lib/src/upper/rlc_am_lte.cc @@ -281,7 +281,7 @@ uint32_t rlc_am_lte::rlc_am_lte_tx::get_buffer_state() RB_NAME, do_status() ? "yes" : "no", status_prohibit_timer.is_running() ? "yes" : "no", - status_prohibit_timer.value(), + status_prohibit_timer.time_elapsed(), status_prohibit_timer.duration()); // Bytes needed for status report diff --git a/lib/test/common/timer_test.cc b/lib/test/common/timer_test.cc index 8e5abaa12..7698a8d3a 100644 --- a/lib/test/common/timer_test.cc +++ b/lib/test/common/timer_test.cc @@ -275,7 +275,7 @@ int timers2_test4() // assert no timer got wrong values for (uint32_t i = 0; i < nof_timers; i++) { if (ctx->timers[i].is_running()) { - TESTASSERT(ctx->timers[i].value() <= ctx->timers[i].duration()); + TESTASSERT(ctx->timers[i].time_elapsed() <= ctx->timers[i].duration()); } } diff --git a/srsenb/src/stack/rrc/rrc.cc b/srsenb/src/stack/rrc/rrc.cc index f280d423c..20d4b768e 100644 --- a/srsenb/src/stack/rrc/rrc.cc +++ b/srsenb/src/stack/rrc/rrc.cc @@ -1022,7 +1022,8 @@ void rrc::ue::activity_timer_expired() { if (parent) { if (parent->rrc_log) { - parent->rrc_log->warning("Activity timer for rnti=0x%x expired after %d ms\n", rnti, activity_timer.value()); + parent->rrc_log->warning( + "Activity timer for rnti=0x%x expired after %d ms\n", rnti, activity_timer.time_elapsed()); } if (parent->s1ap->user_exists(rnti)) { diff --git a/srsue/src/stack/mac/demux.cc b/srsue/src/stack/mac/demux.cc index 829642781..84d475872 100644 --- a/srsue/src/stack/mac/demux.cc +++ b/srsue/src/stack/mac/demux.cc @@ -305,8 +305,10 @@ bool demux::process_ce(srslte::sch_subh* subh) void demux::parse_ta_cmd(srslte::sch_subh *subh) { phy_h->set_timeadv(subh->get_ta_cmd()); - Info("Received TA=%d (%d/%d) \n", subh->get_ta_cmd(), - time_alignment_timer->value(), time_alignment_timer->duration()); + Info("Received TA=%d (%d/%d) \n", + subh->get_ta_cmd(), + time_alignment_timer->time_elapsed(), + time_alignment_timer->duration()); // Start or restart timeAlignmentTimer only if set if (time_alignment_timer->is_set()) { time_alignment_timer->run(); diff --git a/srsue/src/stack/rrc/rrc_procedures.cc b/srsue/src/stack/rrc/rrc_procedures.cc index 9473a0c37..e989b14ef 100644 --- a/srsue/src/stack/rrc/rrc_procedures.cc +++ b/srsue/src/stack/rrc/rrc_procedures.cc @@ -1017,7 +1017,7 @@ srslte::proc_outcome_t rrc::connection_reest_proc::step_cell_reselection() } else { // Out-of-sync, relaunch reselection Info("Serving cell is out-of-sync, re-launching re-selection procedure. T311: %d/%d ms\n", - rrc_ptr->t311.value(), + rrc_ptr->t311.time_elapsed(), rrc_ptr->t311.duration()); if (!rrc_ptr->cell_reselector.launch()) { return proc_outcome_t::error; @@ -1071,7 +1071,7 @@ srslte::proc_outcome_t rrc::connection_reest_proc::cell_criteria() // Actions following cell reselection while T311 is running 5.3.7.3 // Upon selecting a suitable E-UTRA cell, the UE shall: Info("Cell Selection criteria passed after %dms. Sending RRC Connection Reestablishment Request\n", - rrc_ptr->t311.value()); + rrc_ptr->t311.time_elapsed()); // stop timer T311; rrc_ptr->t311.stop();