Commit d1db574c authored by Danil Ruban's avatar Danil Ruban Committed by jperaldi

updating VT in gNB

parent d91dd9ad
...@@ -377,8 +377,8 @@ int create_gNB_tasks(uint32_t gnb_nb) { ...@@ -377,8 +377,8 @@ int create_gNB_tasks(uint32_t gnb_nb) {
return -1; return -1;
} }
if(itti_create_task(TASK_SS_SRB, ss_gNB_vtp_task, NULL) < 0) { if(itti_create_task(TASK_VTP, ss_gNB_vtp_task, NULL) < 0) {
LOG_E(SCTP, "Create task for SS SRB failed\n"); LOG_E(SCTP, "Create task for TASK_VTP failed\n");
return -1; return -1;
} }
......
...@@ -402,8 +402,20 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) { ...@@ -402,8 +402,20 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) {
{ {
LOG_E(NR_PHY, "[SS] Error in L1_Thread itti_send_msg_to_task"); LOG_E(NR_PHY, "[SS] Error in L1_Thread itti_send_msg_to_task");
} }
LOG_D(NR_PHY, "[SS] SS_NRUPD_TIM_INFO from L1_Thread to SYS task itti_send_msg_to_task sfn %d slot %d", }
UL_info->frame, UL_info->slot);
message_p = itti_alloc_new_message(TASK_VTP, INSTANCE_DEFAULT, SS_NRUPD_TIM_INFO);
if (message_p)
{
SS_NRUPD_TIM_INFO(message_p).slot = UL_info->slot;
SS_NRUPD_TIM_INFO(message_p).sfn = UL_info->frame;
int send_res = itti_send_msg_to_task(TASK_VTP, INSTANCE_DEFAULT, message_p);
if (send_res < 0)
{
LOG_E(NR_PHY, "[SS] Error in L1_Thread itti_send_msg_to_task");
}
} }
} }
......
...@@ -325,14 +325,14 @@ ss_gNB_read_from_srb_socket(acpCtx_t ctx) ...@@ -325,14 +325,14 @@ ss_gNB_read_from_srb_socket(acpCtx_t ctx)
void ss_gNB_srb_init(void) void ss_gNB_srb_init(void)
{ {
IpAddress_t ipaddr; IpAddress_t ipaddr;
LOG_A(GNB_APP, "[SS_SRB] Starting System Simulator SRB Thread \n"); LOG_A(GNB_APP, "[SS_SRB] Starting System Simulator SRB Thread (%s) \n", RC.ss.hostIp);
const char *hostIp; const char *hostIp;
hostIp = RC.ss.hostIp; hostIp = RC.ss.hostIp ? RC.ss.hostIp : "127.0.0.1";
acpConvertIp(hostIp, &ipaddr); acpConvertIp(hostIp, &ipaddr);
// Port number // Port number
int port = RC.ss.Srbport; int port = RC.ss.Srbport > 0 ? RC.ss.Srbport : 7778;
acpInit(malloc, free, 1000); acpInit(malloc, free, 1000);
// Register user services/notifications in message table // Register user services/notifications in message table
......
...@@ -146,11 +146,10 @@ void ss_vtp_send_tinfo( ...@@ -146,11 +146,10 @@ void ss_vtp_send_tinfo(
return; return;
} }
else
{ LOG_A(GNB_APP, "[SS-VTP] VTP_Send Success SFN %d SF %d virtualTime.Enable %d mu: %d slot: %d\n",tinfo->sfn,tinfo->sf,virtualTime.Enable, tinfo->mu, tinfo->slot);
LOG_A(GNB_APP, "[SS-VTP] acpSendMsg VTP_Send Success SFN %d SF %d virtualTime.Enable %d\n",tinfo->sfn,tinfo->sf,virtualTime.Enable); SS_context.vtinfo = *tinfo;
SS_context.vtinfo = *tinfo;
}
// Free allocated buffer // Free allocated buffer
acpFree(buffer); acpFree(buffer);
} }
...@@ -299,16 +298,12 @@ static inline uint8_t ss_gNB_read_from_vtp_socket(acpCtx_t ctx) ...@@ -299,16 +298,12 @@ static inline uint8_t ss_gNB_read_from_vtp_socket(acpCtx_t ctx)
} }
else if (userId == MSG_SysVTEnquireTimingAck_userId) else if (userId == MSG_SysVTEnquireTimingAck_userId)
{ {
LOG_A(GNB_APP, "[SS-VTP] Received VTEnquireTimingAck Request\n");
if (acpSysVTEnquireTimingAckDecSrv(ctx, buffer, msgSize, &virtualTime) != 0) if (acpSysVTEnquireTimingAckDecSrv(ctx, buffer, msgSize, &virtualTime) != 0)
{ {
LOG_E(GNB_APP, "[SS-VTP] acpVngProcessDecSrv failed \n"); LOG_E(GNB_APP, "[SS-VTP] acpVngProcessDecSrv failed \n");
break; break;
} }
LOG_A(GNB_APP,"[SS-VTP] Received VTEnquireTimingAck Request SFN %d Subframe %d Waiting for ACK of SFN %d SF %d\n ",
virtualTime->TimingInfo.SFN.v.Number,virtualTime->TimingInfo.Subframe.v.Number,SS_context.vtinfo.sfn,SS_context.vtinfo.sf);
{ {
if (virtualTime->Enable) { if (virtualTime->Enable) {
...@@ -325,10 +320,33 @@ static inline uint8_t ss_gNB_read_from_vtp_socket(acpCtx_t ctx) ...@@ -325,10 +320,33 @@ static inline uint8_t ss_gNB_read_from_vtp_socket(acpCtx_t ctx)
} }
if (virtualTime->TimingInfo.Subframe.d) { if (virtualTime->TimingInfo.Subframe.d) {
LOG_A(GNB_APP, "[SS-VTP]SubFrame: %d\n ", LOG_A(GNB_APP, "[SS-VTP] SubFrame: %d\n ",
virtualTime->TimingInfo.Subframe.v.Number); virtualTime->TimingInfo.Subframe.v.Number);
} }
if (virtualTime->TimingInfo.Slot.d == SlotTimingInfo_Type_SlotOffset) {
LOG_A(GNB_APP, "[SS-VTP] mu: %d\n ", virtualTime->TimingInfo.Slot.v.SlotOffset.d);
switch(virtualTime->TimingInfo.Slot.v.SlotOffset.d) {
case SlotOffset_Type_Numerology0: break;
case SlotOffset_Type_Numerology1:
LOG_A(GNB_APP, "[SS-VTP] slot: %d\n ", virtualTime->TimingInfo.Slot.v.SlotOffset.v.Numerology1);
break;
case SlotOffset_Type_Numerology2:
LOG_A(GNB_APP, "[SS-VTP] slot: %d\n ", virtualTime->TimingInfo.Slot.v.SlotOffset.v.Numerology2);
break;
case SlotOffset_Type_Numerology3:
LOG_A(GNB_APP, "[SS-VTP] slot: %d\n ", virtualTime->TimingInfo.Slot.v.SlotOffset.v.Numerology3);
break;
case SlotOffset_Type_Numerology4:
LOG_A(GNB_APP, "[SS-VTP] slot: %d\n ", virtualTime->TimingInfo.Slot.v.SlotOffset.v.Numerology4);
break;
default:
LOG_E(GNB_APP, "Wrong MU\r\n");
break;
}
}
} else { } else {
ss_send_vtp_resp(virtualTime); ss_send_vtp_resp(virtualTime);
LOG_A(GNB_APP, "[SS-VTP] disabled \n"); LOG_A(GNB_APP, "[SS-VTP] disabled \n");
...@@ -361,6 +379,19 @@ uint8_t ss_gNB_vtp_process_itti_msg(void) ...@@ -361,6 +379,19 @@ uint8_t ss_gNB_vtp_process_itti_msg(void)
tinfo.sfn = SS_UPD_TIM_INFO(received_msg).sfn; tinfo.sfn = SS_UPD_TIM_INFO(received_msg).sfn;
LOG_A(GNB_APP, "[VTP] received VTP_UPD_TIM_INFO SFN: %d SF: %d\n", tinfo.sfn, tinfo.sf); LOG_A(GNB_APP, "[VTP] received VTP_UPD_TIM_INFO SFN: %d SF: %d\n", tinfo.sfn, tinfo.sf);
LOG_A(GNB_APP,"[VTP] received VTP_UPD_TIM_INFO SFN: %d SF: %d\n", tinfo.sfn, tinfo.sf); LOG_A(GNB_APP,"[VTP] received VTP_UPD_TIM_INFO SFN: %d SF: %d\n", tinfo.sfn, tinfo.sf);
if (SS_context.vtp_enabled == 1) {
ss_vtp_send_tinfo(TASK_VTP, &tinfo);
}
}; break;
case SS_NRUPD_TIM_INFO:
{
LOG_W(GNB_APP, "[SS-VTP] VTP received SS_NRUPD_TIM_INFO with sfn=%d slot=%d\n", SS_NRUPD_TIM_INFO(received_msg).sfn, SS_NRUPD_TIM_INFO(received_msg).slot);
ss_set_timinfo_t tinfo;
tinfo.slot = SS_NRUPD_TIM_INFO(received_msg).slot % 2;
tinfo.mu = 1;
tinfo.sf = SS_NRUPD_TIM_INFO(received_msg).slot / 2;
tinfo.sfn = SS_NRUPD_TIM_INFO(received_msg).sfn;
if (SS_context.vtp_enabled == 1) { if (SS_context.vtp_enabled == 1) {
ss_vtp_send_tinfo(TASK_VTP, &tinfo); ss_vtp_send_tinfo(TASK_VTP, &tinfo);
} }
......
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