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
|