Since I am using the ipconfigIPv4_BACKWARD_COMPATIBLE== 1
variant I have implemented my hook like this:
void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent )
{
static BaseType_t prvCreateTCPServerTaskAlreadyCreated = pdFALSE;
/* Check this was a network up event, as opposed to a network down event. */
if( eNetworkEvent == eNetworkUp && prvCreateTCPServerTaskAlreadyCreated == pdFALSE)
{
prvCreateTCPServerTaskAlreadyCreated = pdTRUE;
Queue_Commands_t tcpip_queue_command;
tcpip_queue_command.Command = (uint32_t)NETWORK_UP_EVENT_CAME;
xQueueSendToBack(TCPIP_Command_Queue, &tcpip_queue_command, portMAX_DELAY); // signal tcp server task that network event came
}
}
So basicly my TCP task is waiting in the while(1) loop until this event comes