From 470953bf9c5875646e4d5049c8f213d202fa84fd Mon Sep 17 00:00:00 2001 From: Eric Schreiber Date: Thu, 26 Jul 2018 07:16:34 -0400 Subject: [PATCH] Change the calculation of UE group A random access preamble selection to choose a random number from [0 nof_groupA_preambles) rather than incrementing on the preambleTransmissionCounter. (#200) --- srsue/src/mac/proc_ra.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/srsue/src/mac/proc_ra.cc b/srsue/src/mac/proc_ra.cc index 5b5b56ee7..11e53195c 100644 --- a/srsue/src/mac/proc_ra.cc +++ b/srsue/src/mac/proc_ra.cc @@ -237,7 +237,8 @@ void ra_proc::step_resource_selection() { } if (sel_group == RA_GROUP_A) { if (nof_groupA_preambles) { - sel_preamble = preambleTransmissionCounter%nof_groupA_preambles; + // randomly choose preamble from [0 nof_groupA_preambles) + sel_preamble = rand() % nof_groupA_preambles; } else { rError("Selected group preamble A but nof_groupA_preambles=0\n"); state = RA_PROBLEM; @@ -245,7 +246,8 @@ void ra_proc::step_resource_selection() { } } else { if (nof_groupB_preambles) { - sel_preamble = nof_groupA_preambles + rand()%nof_groupB_preambles; + // randomly choose preamble from [nof_groupA_preambles nof_groupB_preambles) + sel_preamble = nof_groupA_preambles + rand() % nof_groupB_preambles; } else { rError("Selected group preamble B but nof_groupA_preambles=0\n"); state = RA_PROBLEM; @@ -254,7 +256,7 @@ void ra_proc::step_resource_selection() { } sel_maskIndex = 0; } - + rDebug("Selected preambleIndex=%d maskIndex=%d GroupA=%d, GroupB=%d\n", sel_preamble, sel_maskIndex,nof_groupA_preambles, nof_groupB_preambles); state = PREAMBLE_TRANSMISSION;