MCPcopy Create free account
hub / github.com/OpenEPaperLink/OpenEPaperLink / handleUpdateActions

Function handleUpdateActions

ESP32_AP-Flasher/src/ota.cpp:401–421  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

399}
400
401void handleUpdateActions(AsyncWebServerRequest* request) {
402 wsSerial("Performing cleanup");
403 File file = contentFS->open("/update_actions.json", "r");
404 if (!file) {
405 wsSerial("No update_actions.json present");
406 request->send(200, "No update actions needed");
407 return;
408 }
409 JsonDocument doc;
410 DeserializationError error = deserializeJson(doc, file);
411 const JsonArray deleteFiles = doc["deletefile"].as<JsonArray>();
412 for (const auto& filePath : deleteFiles) {
413 if (contentFS->remove(filePath.as<const char*>())) {
414 wsSerial("deleted file: " + filePath.as<String>());
415 }
416 }
417 file.close();
418 wsSerial("Cleanup finished");
419 request->send(200, "Clean up finished");
420 contentFS->remove("/update_actions.json");
421}

Callers

nothing calls this directly

Calls 3

wsSerialFunction · 0.85
openMethod · 0.80
closeMethod · 0.80

Tested by

no test coverage detected