Initial project setup: ESP-IDF + C++ + FreeRTOS + WiFi + web server
This commit is contained in:
27
main/wifi_manager.hpp
Normal file
27
main/wifi_manager.hpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef WIFI_MANAGER_HPP
|
||||
#define WIFI_MANAGER_HPP
|
||||
|
||||
#include <esp_wifi.h>
|
||||
#include <esp_event.h>
|
||||
|
||||
class WiFiManager {
|
||||
public:
|
||||
static WiFiManager& getInstance();
|
||||
|
||||
void init(const char* ssid, const char* password);
|
||||
void connect();
|
||||
void disconnect();
|
||||
bool isConnected() const;
|
||||
const char* getIpAddress() const;
|
||||
|
||||
private:
|
||||
WiFiManager() = default;
|
||||
static WiFiManager instance;
|
||||
bool connected = false;
|
||||
char ip_address[16] = {0};
|
||||
|
||||
static void eventHandler(void* arg, esp_event_base_t event_base,
|
||||
int32_t event_id, void* event_data);
|
||||
};
|
||||
|
||||
#endif // WIFI_MANAGER_HPP
|
||||
Reference in New Issue
Block a user