Added wifmanager

This commit is contained in:
Magnus Persson
2022-01-09 23:12:40 +01:00
parent 7f775d78eb
commit 4ff114642e
9 changed files with 5659 additions and 107 deletions

View File

@ -25,13 +25,13 @@ SOFTWARE.
#define SRC_WIFI_HPP_
// Include
#include <ESP8266WiFi.h>
//#include <ESP8266WiFi.h>
#include <Arduino.h>
// classes
class Wifi {
class WifiConnection {
private:
// WIFI
bool connectedFlag = false;
// OTA
bool newFirmware = false;
@ -40,13 +40,16 @@ class Wifi {
public:
// WIFI
bool connect();
bool disconnect();
bool isConnected() { return connectedFlag; }
bool hasConfig();
String getIPAddress() { return WiFi.localIP().toString(); }
bool startPortal();
void portalLoop();
WifiConnection();
bool connect();
bool disconnect();
bool isConnected();
bool isDoubleResetDetected();
void stopDoubleReset();
bool hasConfig();
String getIPAddress();
void startPortal();
void loop();
// OTA
bool updateFirmware();
@ -54,7 +57,7 @@ class Wifi {
};
// Global instance created
extern Wifi myWifi;
extern WifiConnection myWifi;
#endif // SRC_WIFI_HPP_