NetIF_LinkStateWaitUntilUp

Wait for a network interface's physical link state to be UP.

Files

net_if.h/net_if.c

Prototype

          CPU_BOOLEAN NetIF_LinkStateWaitUntilUp(NET_IF_NBR   if_nbr,
                                                 CPU_INT16U   retry_max,
                                                 CPU_INT32U   time_dly_ms,
                                                 NET_ERR     *p_err);

Arguments

if_nbr

Network interface number to wait for link state to be UP.

retry_max

Maximum number of consecutive socket open retries.

time_dly_ms

Transitory socket open delay value, in milliseconds.

p_err

Pointer to variable that will receive the return error code from this function:

NET_IF_ERR_NONE
NET_IF_ERR_INVALID_IF
NET_IF_ERR_LINK_DOWN
NET_ERR_INIT_INCOMPLETE
NET_ERR_FAULT_LOCK_ACQUIRE

Returned Value

NET_IF_LINK_UP

if no errors and network interface’s physical link state is UP;

NET_IF_LINK_DOWN

otherwise.

Required Configuration

None.

Notes / Warnings

If a non-zero number of retries is requested (retry_max) then a non-zero time delay (time_dly_ms) should also be requested. Otherwise, all retries will most likely fail immediately since no time will elapse to wait for and allow the network interface's link state to successfully be UP.