#pragma once #include #include class ESPMegaDisplayOTA { public: ESPMegaDisplayOTA(ESPMegaDisplay *display, ESPMegaWebServer *webServer); void begin(const char* base_path); private: AsyncCallbackJsonWebHandler *otaUpdateBeginWebHandler; AsyncCallbackJsonWebHandler *otaUpdateWriteWebHandler; AsyncCallbackJsonWebHandler *otaUpdateEndWebHandler; void otaUpdateBeginHandler(AsyncWebServerRequest *request, JsonVariant &json); void otaUpdateWriteHandler(AsyncWebServerRequest *request, JsonVariant &json); void otaUpdateEndHandler(AsyncWebServerRequest *request, JsonVariant &json); AsyncWebServer *server; ESPMegaDisplay *display; size_t updateSize; size_t updateProgress; StaticJsonDocument<512> contentJSON; };