25 lines
443 B
C++
25 lines
443 B
C++
#pragma once
|
|
#include <Arduino.h>
|
|
#include <WiFi.h>
|
|
#include <WebServer.h>
|
|
|
|
class WifiManager {
|
|
public:
|
|
WifiManager();
|
|
void begin();
|
|
bool isConnected();
|
|
void loop();
|
|
String getSSID();
|
|
String getPassword();
|
|
private:
|
|
WebServer server{80};
|
|
String ssid;
|
|
String pass;
|
|
bool apMode;
|
|
void startAP();
|
|
void handleRoot();
|
|
void handleSave();
|
|
void loadCredentials();
|
|
void saveCredentials(const String &s, const String &p);
|
|
};
|