ESPMegaPRO-v3-SDK/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/ESPMegaDisplayOTA.hpp

23 lines
963 B
C++
Raw Normal View History

2024-01-14 17:39:12 +00:00
#pragma once
#include <ESPMegaDisplay.hpp>
#include <ESPMegaWebServer.hpp>
class ESPMegaDisplayOTA {
public:
2024-01-15 07:20:49 +00:00
ESPMegaDisplayOTA();
void begin(const char* base_path, ESPMegaDisplay *display, ESPMegaWebServer *webServer);
2024-01-14 17:39:12 +00:00
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);
2024-01-15 07:20:49 +00:00
void displayWebPageHandler(AsyncWebServerRequest *request);
const char *base_path;
2024-01-14 17:39:12 +00:00
AsyncWebServer *server;
ESPMegaDisplay *display;
2024-01-15 07:20:49 +00:00
ESPMegaWebServer *webServer;
2024-01-14 17:39:12 +00:00
size_t updateSize;
size_t updateProgress;
};