AnsweredAssumed Answered

ipcfg_get_link_active not working

Question asked by vines on Mar 18, 2014
Latest reply on Mar 26, 2014 by vines

Hi,

 

When I used the following code the function works correctly. It will trap the sequence as long as cable is disconnected. Once I connect the cable it will exit my while loop.

 

error = RTCS_create();

if (error != 0)

     _task_block();

if ((ipcfg_init_device(BSP_DEFAULT_ENET_DEVICE, enet_address)) != IPCFG_OK)

     _task_block();

while((ipcfg_get_link_active(BSP_DEFAULT_ENET_DEVICE) == FALSE))

     _time_delay(100);

 

 

 

However if I use the below code it is not working. It is always on the _time_delay whether I plug in/out my cable.

 

error = RTCS_create();

if (error != 0)

     _task_block();

if (ENET_initialize(BSP_DEFAULT_ENET_DEVICE, enet_address, 0, &ehandle) != ENET_OK)

     _task_block();

if (RTCS_if_add(ehandle, RTCS_IF_ENET, &ihandle) != RTCS_OK)

     _task_block();

if (RTCS_if_bind(ihandle, ip.ip, ip.mask) != RTCS_OK)

     _task_block(); 

while((ipcfg_get_link_active(BSP_DEFAULT_ENET_DEVICE) == FALSE))

     _time_delay(100);

 

I am wondering why it is not working when I used the latter code compare to the first code. Do I need to set anything?

 

Thanks.

Outcomes