DHCPc_Start()

Starts the DHCP address configuration and management on the specified interface.

Files

dhcp-c.h/dhcp-c.c

Prototype

          void  DHCPc_Start (NET_IF_NBR       if_nbr,
                             DHCPc_OPT_CODE  *preq_param_tbl,
                             CPU_INT08U       req_param_tbl_qty,
                             DHCPc_ERR       *perr);


Arguments

if_nbr

Interface number to start DHCP configuration and management.

preq_param_tbl

Pointer to table of requested DHCP parameters.

req_param_tbl_qty

Pointer to buffer that will receive the option value.

perr

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

DHCPc_ERR_NONE
DHCPc_ERR_INIT_INCOMPLETE
DHCPc_ERR_IF_INVALID
DHCPc_ERR_PARAM_REQ_TBL_SIZE
DHCPc_ERR_MSG_Q
DHCPc_OS_ERR_LOCK
DHCPc_ERR_IF_INFO_IF_USED
DHCPc_ERR_INVALID_HW_ADDR
DHCPc_ERR_IF_INFO_NONE_AVAIL
DHCPc_ERR_COMM_NONE_AVAIL

Returned Values

None.

Required Configuration

None.

Notes / Warnings

None.

Example Usage

          DHCPc_OPT_CODE  req_param[DHCPc_CFG_PARAM_REQ_TBL_SIZE];
          CPU_INT08U      req_param_qty;
          DHCPc_ERR       err;
           
          req_param[0]  = (DHCPc_OPT_CODE)DHCP_OPT_DOMAIN_NAME_SERVER;
          req_param_qty =  1;
           
          DHCPc_Start((NET_IF_NBR      ) NET_IF_NBR_BASE_CFGD,
                      (DHCPc_OPT_CODE *)&req_param[0],
                      (CPU_INT08U      ) req_param_qty,
                      (DHCPc_ERR      *)&err);
          if (err == DHCPc_ERR_NONE) {
              printf("Interface DHCP management     successfully started\n\r");
          } else { 
              printf("Interface DHCP management NOT successfully started\n\r");
          }