Commit 16c5f59e authored by Jaroslava Fiedlerova's avatar Jaroslava Fiedlerova

Merge remote-tracking branch 'Rakesh_B_B/fix-ngap-time-in-cell' into integration_2026_w02 (!3838)

NR NGAP (N2HO) : Fix Time UE Stayed in Cell IE type and calculation

According to 3GPP TS 38.413, the 'Time UE Stayed in Cell' IE is an
integer ranging from 0 to 4095. This patch updates the data structure
to reflect the correct bit width and implements the dynamic calculation
based on the UE's residence time.

- Change time_in_cell from long to uint16_t in ngap_messages_types.h.
- Replace dummy value with real-time calculation in rrc_gNB_NGAP.c.
- Implement a ceiling of 4095 to comply with the 12-bit protocol limit.

Ref: 3GPP TS 38.413 Section 9.3.1.97
parents 4b32dc58 e7bcca88
...@@ -473,8 +473,8 @@ typedef struct { ...@@ -473,8 +473,8 @@ typedef struct {
cell_id_t id; cell_id_t id;
// Cell type // Cell type
uint8_t type; uint8_t type;
// Time UE Stayed in Cell // Time UE Stayed in Cell (seconds)
long time_in_cell; uint16_t time_in_cell;
// Cause // Cause
ngap_cause_t *cause; ngap_cause_t *cause;
} last_visited_ngran_cell_info_t; } last_visited_ngran_cell_info_t;
......
...@@ -1649,7 +1649,7 @@ void rrc_gNB_send_NGAP_HANDOVER_REQUIRED(gNB_RRC_INST *rrc, ...@@ -1649,7 +1649,7 @@ void rrc_gNB_send_NGAP_HANDOVER_REQUIRED(gNB_RRC_INST *rrc,
msg.source2target->ue_history_info.cause->type = NGAP_CAUSE_RADIO_NETWORK; msg.source2target->ue_history_info.cause->type = NGAP_CAUSE_RADIO_NETWORK;
msg.source2target->ue_history_info.cause->value = NGAP_CAUSE_RADIO_NETWORK_HANDOVER_DESIRABLE_FOR_RADIO_REASON; msg.source2target->ue_history_info.cause->value = NGAP_CAUSE_RADIO_NETWORK_HANDOVER_DESIRABLE_FOR_RADIO_REASON;
msg.source2target->ue_history_info.type = NGAP_CellSize_small; msg.source2target->ue_history_info.type = NGAP_CellSize_small;
msg.source2target->ue_history_info.time_in_cell = 500; // dummy number for now msg.source2target->ue_history_info.time_in_cell = min(time(NULL) - UE->last_seen, 4095);
msg.source2target->ue_history_info.id = target_cell; msg.source2target->ue_history_info.id = target_cell;
/* Fill both PDU Session Resource List IE (M) in Handover Required /* Fill both PDU Session Resource List IE (M) in Handover Required
......
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