Files
P4-USB-transfer/main/WIFI/wifi.h
T
zhengxinandCursor 851e347cf5 初始提交卡包 USB 工程
纳入固件源码、屏幕组件、nand_xfer 工具和文档。忽略本机构建产物、sdkconfig,以及含本机路径的依赖锁。

Co-authored-by: Cursor <[email protected]>
2026-10-13 21:54:50 +08:00

27 lines
830 B
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#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_ */