2025-11-28 18:26:32 -06:00
|
|
|
#ifndef WIFI_H
|
|
|
|
|
#define WIFI_H
|
|
|
|
|
|
2025-11-29 16:24:56 -06:00
|
|
|
#include "esp_wifi.h"
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
class WiFi {
|
|
|
|
|
public:
|
|
|
|
|
static void init();
|
|
|
|
|
static bool attemptConnect(char *SSID, char *PW, wifi_auth_mode_t authMode);
|
2025-12-17 13:15:55 -06:00
|
|
|
static bool attemptConnect(char *SSID, char *username, char *PW,
|
|
|
|
|
wifi_auth_mode_t authMode);
|
2025-11-29 16:24:56 -06:00
|
|
|
private:
|
|
|
|
|
static bool authFailed;
|
|
|
|
|
static bool awaitConnected();
|
|
|
|
|
static esp_event_handler_instance_t instance_any_id;
|
|
|
|
|
static esp_event_handler_instance_t instance_got_ip;
|
|
|
|
|
static EventGroupHandle_t s_wifi_event_group;
|
|
|
|
|
static esp_netif_t* netif;
|
|
|
|
|
static void event_handler(void* arg, esp_event_base_t event_base,
|
|
|
|
|
int32_t event_id, void* event_data);
|
|
|
|
|
static bool isConnected();
|
|
|
|
|
static std::string getIP();
|
|
|
|
|
};
|
|
|
|
|
|
2025-11-28 18:26:32 -06:00
|
|
|
void scanAndUpdateSSIDList();
|
|
|
|
|
|
|
|
|
|
#endif
|