- 新增 wifi-connect 组件(AP 配网、DNS 劫持、Captive Portal) - 支持长按按键进入配网,网页配置路由器 SSID/密码 - 增加清除已保存 Wi-Fi 参数能力(API + 页面按钮) - 增加中文状态日志与中文注释,优化配网交互 - 补充组件文档:README、USER_GUIDE、QUICK_POSTER、BLOG
35 lines
722 B
C
35 lines
722 B
C
#pragma once
|
|
|
|
#include <stdbool.h>
|
|
#include "esp_err.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef enum {
|
|
WIFI_CONNECT_STATUS_IDLE = 0,
|
|
WIFI_CONNECT_STATUS_PROVISIONING,
|
|
WIFI_CONNECT_STATUS_CONNECTING,
|
|
WIFI_CONNECT_STATUS_CONNECTED,
|
|
WIFI_CONNECT_STATUS_FAILED,
|
|
WIFI_CONNECT_STATUS_TIMEOUT,
|
|
} wifi_connect_status_t;
|
|
|
|
typedef struct {
|
|
bool has_config;
|
|
char ssid[33];
|
|
char password[65];
|
|
} wifi_connect_config_t;
|
|
|
|
esp_err_t wifi_connect_init(void);
|
|
esp_err_t wifi_connect_start(void);
|
|
esp_err_t wifi_connect_stop(void);
|
|
wifi_connect_status_t wifi_connect_get_status(void);
|
|
esp_err_t wifi_connect_get_config(wifi_connect_config_t *config);
|
|
esp_err_t wifi_connect_clear_config(void);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|