DHCPc_ChkStatus()

Checks an interface’s DHCP status and last error.

Files

dhcp-c.h/dhcp-c.c

Prototype

          void DHPCc_ChkStatus (NET_IF_NBR   if_nbr,
                                DHCPc_ERR   *perr_last);

Arguments

if_nbr Interface number to check status.

perr_last

Pointer to variable that will receive the last return error code for this interface:

DHCPc_ERR_NONE

DHCPc_ERR_INIT_INCOMPLETE

DHCPc_ERR_IF_NOT_MANAGED

Returned Values

DHCP status for the interface.

Required Configuration

None.

Notes / Warnings

None.

Example Usage

          DHCPc_STATUS  status;
          DHCPc_ERR     err;
           
          status = DHPCc_ChkStatus(NET_IF_NBR_BASE_CFGD, &err);
          switch (status) {
              case DHCP_STATUS_CFGD:
              case DHCP_STATUS_NO_TMR:
              case DHCP_STATUS_LOCAL_LINK:
                   printf("Interface configured\n\r");
                   break; 
           
              default: 
                   printf("Interface NOT configured\n\r");
                   break; 
          }