From 715f8900a8e2f5ceb530a16f9d6475d34b92f5e1 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Tue, 20 Apr 2021 14:34:49 +0200 Subject: [PATCH] Selected NR RA procedure PRACH send timeout according to system frame number period from PRACH PHY tables --- srsue/hdr/stack/mac_nr/proc_ra_nr.h | 4 ++++ srsue/src/stack/mac_nr/proc_ra_nr.cc | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/srsue/hdr/stack/mac_nr/proc_ra_nr.h b/srsue/hdr/stack/mac_nr/proc_ra_nr.h index cdef546c2..d3e2a02b0 100644 --- a/srsue/hdr/stack/mac_nr/proc_ra_nr.h +++ b/srsue/hdr/stack/mac_nr/proc_ra_nr.h @@ -51,6 +51,10 @@ public: void reset(); private: + static const uint32_t PRACH_SEND_CALLBACK_TIMEOUT = + 16 * 10; ///< Limited from frame system number opportunity period in TS 38.211 tables 6.3.3.2-2, 6.3.3.2-3 + ///< and 6.3.3.2-4 + mac_interface_proc_ra_nr& mac; srslog::basic_logger& logger; phy_interface_mac_nr* phy = nullptr; diff --git a/srsue/src/stack/mac_nr/proc_ra_nr.cc b/srsue/src/stack/mac_nr/proc_ra_nr.cc index 0a94bf0b7..3bfb1e71a 100644 --- a/srsue/src/stack/mac_nr/proc_ra_nr.cc +++ b/srsue/src/stack/mac_nr/proc_ra_nr.cc @@ -172,7 +172,7 @@ void proc_ra_nr::ra_preamble_transmission() // instruct the physical layer to transmit the Random Access Preamble using the selected PRACH occasion, corresponding // RA-RNTI (if available), PREAMBLE_INDEX, and PREAMBLE_RECEIVED_TARGET_POWER. phy->send_prach(prach_occasion, preamble_index, preamble_received_target_power); - prach_send_timer.set(100, [this](uint32_t tid) { timer_expired(tid); }); // TODO find a suitable 100? + prach_send_timer.set(PRACH_SEND_CALLBACK_TIMEOUT, [this](uint32_t tid) { timer_expired(tid); }); prach_send_timer.run(); state = WAITING_FOR_PRACH_SENT; }