Hi.
This is the below code which I am using
The problem here is - I get the events in the following order
NetweorkUp
NetworkDown
DFCP events
NetworkUp
I am perplexed why the networkUp event occurs as soon as I call FreeRTOS_IPInit_Multi as I expect it to come only after the DHCP link is established.
pxFSP_Eth_FillInterfaceDescriptor( 0, &( xInterfaces[ 0 ] ) );
FreeRTOS_FillEndPoint( &( xInterfaces[ 0 ] ), &( xEndPoints[ 0 ] ), ucIPAddress, ucNetMask, ucGatewayAddress, ucDNSServerAddress, ucMACAddress );
#if ( ipconfigUSE_DHCP != 0 )
{
xEndPoints[ 0 ].bits.bWantDHCP = pdTRUE;
}
#endif /* ipconfigUSE_DHCP */
sock_err = FreeRTOS_IPInit_Multi();
if (1 == sock_err)
{
/*do nothing */
}
else
{
//TEST_PROCESS_PRINT(TEST_ERROR,"FREERTOS_IPINIT FAILED.\r\n");
}
while (pdFALSE == FreeRTOS_IsNetworkUp())
{
vTaskDelay(10);
}
flag=false;
while(flag==false)
{
vTaskDelay(10);
}
while (pdFALSE == FreeRTOS_IsNetworkUp())
{
vTaskDelay(10);
}
xClientSocket = FreeRTOS_socket( FREERTOS_AF_INET,
FREERTOS_SOCK_STREAM , /* SOCK_STREAM for TCP. */
FREERTOS_IPPROTO_TCP );
vIPNetworkUpCalls
is called from prvCheckLinkStatusTask