🛜 Simplifies ap service

This commit is contained in:
Rune Harlyk
2024-09-03 21:16:40 +02:00
committed by Rune Harlyk
parent 8ac2fad1b1
commit 756f1c0148
7 changed files with 99 additions and 193 deletions
+38
View File
@@ -0,0 +1,38 @@
#include <StatefulService.h>
#include <stateful_service_endpoint.h>
#include <FSPersistence.h>
#include <ap_settings.h>
#include <timing.h>
#include <WiFi.h>
class APService : public StatefulService<APSettings> {
public:
APService();
~APService();
void begin();
void loop();
void recoveryMode();
esp_err_t getStatus(PsychicRequest *request);
void status(JsonObject &root);
APNetworkStatus getAPNetworkStatus();
StatefulHttpEndpoint<APSettings> endpoint;
private:
PsychicHttpServer *_server;
FSPersistence<APSettings> _fsPersistence;
DNSServer *_dnsServer;
volatile unsigned long _lastManaged;
volatile boolean _reconfigureAp;
volatile boolean _recoveryMode = false;
void reconfigureAP();
void manageAP();
void startAP();
void stopAP();
void handleDNS();
};