Commit 86516822 authored by Francesco Mani's avatar Francesco Mani

5G connected after sending msg2

parent f4ccaf0d
...@@ -462,7 +462,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -462,7 +462,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
} }
if (get_softmodem_params()->phy_test == 0) if (get_softmodem_params()->phy_test == 0)
nr_schedule_RA(module_idP, frame_txP, slot_txP); nr_schedule_RA(module_idP, frame_txP, slot_txP, UE_id);
else else
UE_list->fiveG_connected[UE_id] = true; UE_list->fiveG_connected[UE_id] = true;
......
...@@ -341,11 +341,12 @@ void nr_initiate_ra_proc(module_id_t module_idP, ...@@ -341,11 +341,12 @@ void nr_initiate_ra_proc(module_id_t module_idP,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_INITIATE_RA_PROC, 0); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_INITIATE_RA_PROC, 0);
} }
void nr_schedule_RA(module_id_t module_idP, frame_t frameP, sub_frame_t slotP){ void nr_schedule_RA(module_id_t module_idP, frame_t frameP, sub_frame_t slotP, int UE_id){
//uint8_t i = 0; //uint8_t i = 0;
int CC_id = 0; int CC_id = 0;
gNB_MAC_INST *mac = RC.nrmac[module_idP]; gNB_MAC_INST *mac = RC.nrmac[module_idP];
NR_UE_list_t *UE_list = &mac->UE_list;
NR_COMMON_channels_t *cc = &mac->common_channels[CC_id]; NR_COMMON_channels_t *cc = &mac->common_channels[CC_id];
NR_RA_t *ra = &cc->ra[0]; NR_RA_t *ra = &cc->ra[0];
...@@ -356,6 +357,9 @@ void nr_schedule_RA(module_id_t module_idP, frame_t frameP, sub_frame_t slotP){ ...@@ -356,6 +357,9 @@ void nr_schedule_RA(module_id_t module_idP, frame_t frameP, sub_frame_t slotP){
switch (ra->state){ switch (ra->state){
case Msg2: case Msg2:
nr_generate_Msg2(module_idP, CC_id, frameP, slotP); nr_generate_Msg2(module_idP, CC_id, frameP, slotP);
UE_list->fiveG_connected[UE_id] = true;
LOG_I(MAC, "[gNB %d][RAPROC] PUSCH with TC_RNTI %x received correctly and UE_id %d is now 5G connected\n",
module_idP, ra->rnti, UE_id);
break; break;
case Msg4: case Msg4:
//generate_Msg4(module_idP, CC_id, frameP, slotP, ra); //generate_Msg4(module_idP, CC_id, frameP, slotP, ra);
......
...@@ -311,12 +311,12 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -311,12 +311,12 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
if (sduP != NULL) { // if the CRC passed if (sduP != NULL) { // if the CRC passed
for (int i = 0; i < MAX_MOBILES_PER_GNB; i++) { for (int i = 0; i < MAX_MOBILES_PER_GNB; i++) {
if (UE_list->active[i] == TRUE) { if (UE_list->active[i] == TRUE) {
if (UE_list->tc_rnti[i] == current_rnti) { /* if (UE_list->tc_rnti[i] == current_rnti) {
// for now the only thing we are doing is set the UE as 5G connected // for now the only thing we are doing is set the UE as 5G connected
UE_list->fiveG_connected[i] = true; UE_list->fiveG_connected[i] = true;
LOG_I(MAC, "[gNB %d][RAPROC] PUSCH with TC_RNTI %x received correctly and UE_id %d is now 5G connected\n", LOG_I(MAC, "[gNB %d][RAPROC] PUSCH with TC_RNTI %x received correctly and UE_id %d is now 5G connected\n",
gnb_mod_idP, current_rnti, i); gnb_mod_idP, current_rnti, i);
} }*/
} }
} }
} }
......
...@@ -81,7 +81,7 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t subfram ...@@ -81,7 +81,7 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t subfram
/////// Random Access MAC-PHY interface functions and primitives /////// /////// Random Access MAC-PHY interface functions and primitives ///////
void nr_schedule_RA(module_id_t module_idP, frame_t frameP, sub_frame_t slotP); void nr_schedule_RA(module_id_t module_idP, frame_t frameP, sub_frame_t slotP, int UE_id);
/* \brief Function to indicate a received preamble on PRACH. It initiates the RA procedure. /* \brief Function to indicate a received preamble on PRACH. It initiates the RA procedure.
@param module_idP Instance ID of gNB @param module_idP Instance ID of gNB
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment