Commit c074d146 authored by jperaldi's avatar jperaldi

issue#75 need to respect on ACP port interface the same logic. SysInd port management updated

parent 8c74bd92
......@@ -329,6 +329,7 @@ void *rrc_enb_process_msg(void *);
TASK_DEF(TASK_SS_PORTMAN, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_SYS, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_SS_SYSIND, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_SS_SYSIND_ACP, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_SS_SRB, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_SS_SRB_ACP, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_VNG, TASK_PRIORITY_MED, 200, NULL, NULL) \
......
......@@ -141,6 +141,67 @@ static void ss_send_sysind_data(ss_system_ind_t *p_ind)
}
/*
* Function : ss_eNB_read_from_sysind_socket
* Description: Function to received message from SYSIND Socket
* In :
* req - Request received from the TTCN
* Out:
* newState: No impack on the State
*
*/
static bool isConnected = false;
static inline void
ss_eNB_read_from_sysind_socket(acpCtx_t ctx)
{
size_t msgSize = size; //2
while (1)
{
int userId = acpRecvMsg(ctx, &msgSize, buffer);
LOG_A(ENB_SS, "[SS_SYSIND] Received msgSize=%d, userId=%d\n", (int)msgSize, userId);
// Error handling
if (userId < 0)
{
if (userId == -ACP_ERR_SERVICE_NOT_MAPPED)
{
// Message not mapped to user id,
// this error should not appear on server side for the messages received from clients
}
else if (userId == -ACP_ERR_SIDL_FAILURE)
{
// Server returned service error,
// this error should not appear on server side for the messages received from clients
SidlStatus sidlStatus = -1;
acpGetMsgSidlStatus(msgSize, buffer, &sidlStatus);
}
else if (userId == -ACP_PEER_DISCONNECTED){
LOG_A(GNB_APP, "[SS_SYSIND] Peer ordered shutdown\n");
isConnected = false;
}
else if (userId == -ACP_PEER_CONNECTED){
LOG_A(GNB_APP, "[SS_SYSIND] Peer connection established\n");
isConnected = true;
}
else
{
LOG_A(ENB_SS, "[SS_SYSIND] Invalid userId: %d \n", userId);
break;
}
}
if (userId == 0)
{
// No message (timeout on socket)
if (isConnected == true)
{
break;
}
}
}
}
/*
* Function : ss_eNB_sysind_init
* Description: Function handles for initilization of SYSIND task
......@@ -262,14 +323,29 @@ void *ss_eNB_sysind_process_itti_msg(void *notUsed)
*/
void *ss_eNB_sysind_task(void *arg)
{
ss_eNB_sysind_init();
while (1)
{
(void)ss_eNB_sysind_process_itti_msg(NULL);
}
acpFree(buffer);
return NULL;
}
/*
* Function : ss_eNB_sysind_acp_task
* Description: Funtion Handles the SYSIND ACP Task
* In :
* req :
* Out:
* newState: No impact on state machine.
*
*/
void *ss_eNB_sysind_acp_task(void *arg)
{
ss_eNB_sysind_init();
while (1)
{
ss_eNB_read_from_sysind_socket(ctx_sysind_g);
}
acpFree(buffer);
}
......@@ -4,5 +4,6 @@
void ss_eNB_sysind_init(void);
void *ss_eNB_sysind_process_itti_msg(void *);
void *ss_eNB_sysind_task(void *arg);
void *ss_eNB_sysind_acp_task(void *arg);
#endif /* SS_ENB_SYSIND_TASK_H_ */
......@@ -74,6 +74,9 @@ int create_tasks(uint32_t enb_nb) {
rc = itti_create_task(TASK_SS_SYSIND, ss_eNB_sysind_task, NULL);
AssertFatal(rc >= 0, "Create task for SS SYSIND failed\n");
rc = itti_create_task(TASK_SS_SYSIND_ACP, ss_eNB_sysind_acp_task, NULL);
AssertFatal(rc >= 0, "Create task for SS SYSIND ACP failed\n");
rc = itti_create_task(TASK_SS_SRB, ss_eNB_srb_task, NULL);
AssertFatal(rc >= 0, "Create task for SS SRB failed\n");
......
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