www.beck-ipc.com

@CHIP-RTOS C Library - TCP/IP API


Dev_Wait_DHCP_Complete

Waits for completion of IPv4 configuration process by DHCP
(Dynamic Host Configuration Protocol ).  

int Dev_Wait_DHCP_Complete(DevUserDriver far * DriverInfo,
                           unsigned int time_s,
                           int * errorcode);

Parameters

DriverInfo

Pointer to user driver information.

time_s

Timeout seconds.   This value will depend on the DHCP server used.   A minimum value of 15 seconds is recommended.

errorcode

Output parameter:  Failure code, 0 on success.

Return Value

0: success
-1: See reported errorcode .

Comments

On success, the IPv4 address and netmask obtained via DHCP will be output to the IpAddr and Netmask members of the referenced DevUserDriver object.   Additional DHCP information can then be found at the location reported in the Dhcp_Data member.

This function should only be used following a successful call to Dev_Open_Interface() when the use_dhcp member of the DevUserDriver structure was set to 1.

Go here for further explanations and an example with source code.

See Also

RTOS API

This library function invokes a RTOS software interrupt. Refer to this RTOS API function's documentation for more details.

On SC1x3/SC2x (RTOS version >=1.13, CLIB version >=2.10) there's also a version of this function which uses dynamic linking instead of a software interrupt, which reduces the function's overhead and thus speeds up your application. This function's name is Dev_Wait_DHCP_Complete_Dyn. You should however not use this function directly. Instead you should add the define TCPIP_DYN_LINK_DEV to your program before including the CLIB's header file(s):

    #define TCPIP_DYN_LINK_DEV
    #include <clib.h>


This will map the original function's name to the dynamic linking version. This way you can also easily switch existing programs to dynamic linking.

Supported since or modified in @CHIP-RTOS version

    SC12SC13SC11SC1x3SC2x
    V1.10V1.00V1.00V0.90V1.00

This API List
List of C Libraries
@CHIP-RTOS Main Index


End of document