Commit e2627f80 authored by rmagueta's avatar rmagueta

Improve UE mode

parent acb9a6e0
......@@ -867,8 +867,9 @@ typedef enum {
NOT_SYNCHED=0,
PRACH=1,
RA_RESPONSE=2,
PUSCH=3,
RESYNCH=4
RA_WAIT_CR=3,
PUSCH=4,
RESYNCH=5
} UE_MODE_t;
#define FOREACH_PARALLEL(GEN) \
......
......@@ -2209,17 +2209,14 @@ void nr_ue_prach_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t
nr_Msg1_transmitted(mod_id, ue->CC_id, frame_tx, gNB_id);
} else if (nr_prach == 2) {
LOG_D(PHY, "In %s: [UE %d] RA completed, setting UE mode to PUSCH\n", __FUNCTION__, mod_id);
LOG_W(PHY, "In %s: [UE %d] RA waiting contention resolution\n", __FUNCTION__, mod_id);
ue->UE_mode[gNB_id] = RA_WAIT_CR;
} else if (nr_prach == 3) {
LOG_W(PHY, "In %s: [UE %d] RA completed, setting UE mode to PUSCH\n", __FUNCTION__, mod_id);
ue->UE_mode[gNB_id] = PUSCH;
} else if(nr_prach == 3){
LOG_D(PHY, "In %s: [UE %d] RA failed, setting UE mode to PRACH\n", __FUNCTION__, mod_id);
} else if(nr_prach == 4){
LOG_W(PHY, "In %s: [UE %d] RA failed, setting UE mode to PRACH\n", __FUNCTION__, mod_id);
ue->UE_mode[gNB_id] = PRACH;
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_PRACH, VCD_FUNCTION_OUT);
......
......@@ -664,6 +664,8 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
}
}
} else {
return 3;
}
if (ra->RA_contention_resolution_timer_active){
......@@ -779,7 +781,7 @@ void nr_ra_succeeded(module_id_t mod_id, frame_t frame, int slot){
LOG_D(MAC, "In %s: [UE %d] clearing RA_active flag...\n", __FUNCTION__, mod_id);
ra->RA_active = 0;
ra->generate_nr_prach = 2;
ra->generate_nr_prach = 3;
ra->ra_state = RA_SUCCEEDED;
}
......@@ -795,7 +797,7 @@ void nr_ra_failed(uint8_t mod_id, uint8_t CC_id, NR_PRACH_RESOURCES_t *prach_res
RA_config_t *ra = &mac->ra;
ra->first_Msg3 = 0;
ra->generate_nr_prach = 3;
ra->generate_nr_prach = 4;
ra->ra_state = RA_UE_IDLE;
prach_resources->RA_PREAMBLE_TRANSMISSION_COUNTER++;
......
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