From cf8dff2093f0a65c3a90285290263b8bdc756aa5 Mon Sep 17 00:00:00 2001 From: Roberto Louro Magueta Date: Mon, 13 Mar 2023 19:45:31 +0000 Subject: [PATCH] Implementation to update the RRC timers at UE --- executables/nr-uesoftmodem.c | 5 +++++ openair2/RRC/NR_UE/rrc_UE.c | 26 ++++++++++++++++++++++++++ openair2/RRC/NR_UE/rrc_proto.h | 3 +++ 3 files changed, 34 insertions(+) diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index eb6e160ec3..5cef04f195 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -211,6 +211,11 @@ int create_tasks_nrue(uint32_t ue_nb) { } itti_wait_ready(0); + + // Thread to update the RRC timers (in msec) at UE + pthread_t timers_update; + threadCreate(&timers_update, nr_rrc_timers_update, NULL, "nr_rrc_timer_update", -1, OAI_PRIORITY_RT_LOW); + return 0; } diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index 9f47cf7640..6ee8c762fc 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -2890,3 +2890,29 @@ void process_lte_nsa_msg(nsa_msg_t *msg, int msg_len) LOG_E(NR_RRC, "No NSA Message Found\n"); } } + +void *nr_rrc_timers_update() { + + while (1) { + + for (int mod_id = 0; mod_id < NB_NR_UE_INST; mod_id++) { + for (int i = 0; i < NB_SIG_CNX_UE; i++) { + NR_UE_RRC_INFO *timers = &NR_UE_rrc_inst[mod_id].Info[i]; + + // T304 + if (timers->T304_active == 1) { + if ((timers->T304_cnt % 100) == 0) { + LOG_W(NR_RRC, "T304: %u\n", timers->T304_cnt); + } + if (timers->T304_cnt == 1) { + timers->T304_active = 0; + } + timers->T304_cnt--; + } + + } + } + + usleep(1000); + } +} diff --git a/openair2/RRC/NR_UE/rrc_proto.h b/openair2/RRC/NR_UE/rrc_proto.h index 48b8510de5..2739c7ccf8 100644 --- a/openair2/RRC/NR_UE/rrc_proto.h +++ b/openair2/RRC/NR_UE/rrc_proto.h @@ -162,6 +162,9 @@ int8_t nr_rrc_RA_succeeded(const module_id_t mod_id, const uint8_t gNB_index); \param void *args_p Pointer on arguments to start the task. */ void *rrc_nrue_task(void *args_p); +/**\brief RRC timers update at UE. */ +void *nr_rrc_timers_update(); + /**\brief RRC NSA UE task. \param void *args_p Pointer on arguments to start the task. */ void *recv_msgs_from_lte_ue(void *args_p);