From d056e6fa7bab5890cac4711881879c83aa7d29e5 Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Mon, 13 Nov 2023 15:31:50 +0700 Subject: [PATCH] lcd upload endpoint --- .vscode/settings.json | 3 ++- src/espmega_iot_core.cpp | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 69aa100..6c7e3e2 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -15,6 +15,7 @@ "*.d": "cpp", "*.html": "cpp", "*.tcc": "cpp", - "regex": "cpp" + "regex": "cpp", + "cstdlib": "cpp" } } \ No newline at end of file diff --git a/src/espmega_iot_core.cpp b/src/espmega_iot_core.cpp index 0ff5efc..e613732 100644 --- a/src/espmega_iot_core.cpp +++ b/src/espmega_iot_core.cpp @@ -423,6 +423,19 @@ void ota_begin() } } }); + otaserver.on("/lcd_update",HTTP_POST,[]() { + otaserver.sendHeader("Connection","close"); + },[](){ + HTTPUpload &upload = otaserver.upload(); + if(upload.status == UPLOAD_FILE_START) { + Serial.println(upload.totalSize); + } else if (upload.status == UPLOAD_FILE_WRITE) { + for(int i = 0; i