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)

This commit is contained in:
Eric Schreiber 2018-07-26 07:16:34 -04:00 committed by Andre Puschmann
parent dfce3ea155
commit 470953bf9c
1 changed files with 5 additions and 3 deletions

View File

@ -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;