TuyaOS
lwip_dhcpc.h
浏览该文件的文档.
1
9#ifndef __LWIP_DHCPC_H
10#define __LWIP_DHCPC_H
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16#include "lwip/tcpip.h"
17#include "lwip/init.h" //for lwip version control
18#include "lwip/err.h"
19
20/***********************************************************
21*************************micro define***********************
22***********************************************************/
23/* state machine of dhcp client */
24typedef enum {
25 DHCP_START = 0, //启动DHCP CLIENT
26 DHCP_WAIT_ADDRESS, //IP地址获取中
27 DHCP_ADDRESS_ASSIGNED, //已经获取到IP地址
28 DHCP_RELEASE_IP, //释放IP地址
29 DHCP_STOP, //停止DHCP CLIENT
30 DHCP_TIMEOUT //DHCP获取IP地址超时
31} TUYA_DHCP_CLIENT_STATUS;
32
33typedef void (*dhcpc_cb_t)(unsigned int ip, unsigned int mask, unsigned int gw);
34
35/***********************************************************
36*************************variable define********************
37***********************************************************/
38
39/***********************************************************
40*************************function define********************
41***********************************************************/
42
43
51void dhcpc_set_new_lease_cb(dhcpc_cb_t cb);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif /* __LWIP_DHCPC_H */
int tuya_dhcp_client_start(void)
start dhcp client thread to get ip for WIFI STATION mode