NetIF_AddrHW_Set

Set network interface’s hardware address.

Files

net_if.h/net_if.c

Prototype

          void NetIF_AddrHW_Set(NET_IF_NBR   if_nbr,
                                CPU_INT08U  *p_addr_hw,
                                CPU_INT08U   addr_len,
                                NET_ERR     *p_err);

Arguments

if_nbr

Network interface number to set hardware address.

p_addr_hw

Pointer to a hardware address.

addr_len

Length of hardware address.

p_err

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

NET_IF_ERR_NONE
NET_IF_ERR_NULL_PTR
NET_IF_ERR_NULL_FNCT
NET_IF_ERR_INVALID_IF
NET_IF_ERR_INVALID_CFG
NET_IF_ERR_INVALID_STATE
NET_IF_ERR_INVALID_ADDR
NET_IF_ERR_INVALID_ADDR_LEN
NET_ERR_FAULT_LOCK_ACQUIRE

Returned Value

None.

Required Configuration

None.

Notes / Warnings

The hardware address must be in network-order (i.e., the pointer to the hardware address must point to the highest-order byte).

The network interface must be stopped before setting a new hardware address, which does not take effect until the interface is re-started.

Additional error codes may be returned by the specific interface or device driver.