working basic OTA
This commit is contained in:
parent
df09914bd3
commit
a2fe4a3d67
5 changed files with 207 additions and 195 deletions
|
@ -86,12 +86,13 @@ void ESPMegaDisplayOTA::otaUpdateWriteHandler(AsyncWebServerRequest *request, Js
|
|||
}
|
||||
// Write the data to the display
|
||||
display->writeUpdate(data_array, size);
|
||||
request->send(200, "application/json", "{\"status\": \"success\"}");
|
||||
request->send(200, "application/json", "{\"status\": \"success\",\"bytes_written\": "+String(this->display->getOtaBytesWritten())+"}");
|
||||
}
|
||||
void ESPMegaDisplayOTA::otaUpdateEndHandler(AsyncWebServerRequest *request, JsonVariant &json) {
|
||||
this->webServer->checkAuthentication(request);
|
||||
display->endUpdate();
|
||||
request->send(200, "application/json", "{\"status\": \"success\"}");
|
||||
esp_restart();
|
||||
}
|
||||
|
||||
void ESPMegaDisplayOTA::displayWebPageHandler(AsyncWebServerRequest *request) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue