27 lines
830 B
C
27 lines
830 B
C
#ifndef _WIFI_H_
|
||||
|
|
#define _WIFI_H_
|
|||
|
|
#include <stdbool.h>
|
|||
|
|
|
|||
|
|
#define WIFI_EVENT_CONNECTED_BIT BIT0 // WIFI 已经连接
|
|||
|
|
#define WIFI_EVENT_FAIL_BIT BIT1
|
|||
|
|
#define EXAMPLE_ESP_MAXIMUM_RETRY 3
|
|||
|
|
|
|||
|
|
typedef enum
|
|||
|
|
{
|
|||
|
|
wifi_disconnected = 0,
|
|||
|
|
wifi_connected =!wifi_disconnected,
|
|||
|
|
}WIFI_STATE;
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
void wifi_main(char* ss, char* pass);
|
|||
|
|
/** 停止 STA 并 deinit WiFi 驱动(表情包收尾恢复 LVGL 前腾内存;需网络时再次 wifi_init_sta/mqtt_main) */
|
|||
|
|
void wifi_network_shutdown_full(void);
|
|||
|
|
WIFI_STATE wifi_init_sta(void);
|
|||
|
|
bool wifi_is_connected_now(void);
|
|||
|
|
/** STA 已用尽自动重连次数(与 event_handler 中 else 分支一致) */
|
|||
|
|
bool wifi_sta_reconnect_exhausted(void);
|
|||
|
|
/** 未拿到 IP 且重连次数未用尽,驱动仍可能自动 esp_wifi_connect */
|
|||
|
|
bool wifi_sta_still_reconnecting(void);
|
|||
|
|
|
|||
|
|
#endif /* _WIFI_H_ */
|