From d056e6fa7bab5890cac4711881879c83aa7d29e5 Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Mon, 13 Nov 2023 15:31:50 +0700 Subject: [PATCH 1/9] 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 Date: Thu, 7 Dec 2023 12:27:46 +0700 Subject: [PATCH 2/9] temp change upload endpoint to lcd --- .gitignore | 3 +- .vscode/settings.json | 78 ------------------------------------- src/ota_html/ota-part3.html | 2 +- 3 files changed, 3 insertions(+), 80 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore index a4a37ad..8b617f4 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ .vscode/ .vscode/settings.json firmware/ -release/ \ No newline at end of file +release/ +.vscode/extensions.json diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index ee32b37..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "C_Cpp.errorSquiggles": "enabled", - "files.associations": { - "*.cps": "javascript", - "string": "cpp", - "optional": "cpp", - "istream": "cpp", - "ostream": "cpp", - "system_error": "cpp", - "array": "cpp", - "functional": "cpp", - "tuple": "cpp", - "type_traits": "cpp", - "utility": "cpp", - "*.d": "cpp", - "*.html": "cpp", - "*.tcc": "cpp", - "regex": "cpp" - }, - "C_Cpp_Runner.msvcBatchPath": "", - "C_Cpp_Runner.cCompilerPath": "gcc", - "C_Cpp_Runner.cppCompilerPath": "g++", - "C_Cpp_Runner.debuggerPath": "gdb", - "C_Cpp_Runner.cStandard": "", - "C_Cpp_Runner.cppStandard": "", - "C_Cpp_Runner.useMsvc": false, - "C_Cpp_Runner.warnings": [ - "-Wall", - "-Wextra", - "-Wpedantic", - "-Wshadow", - "-Wformat=2", - "-Wcast-align", - "-Wconversion", - "-Wsign-conversion", - "-Wnull-dereference" - ], - "C_Cpp_Runner.msvcWarnings": [ - "/W4", - "/permissive-", - "/w14242", - "/w14287", - "/w14296", - "/w14311", - "/w14826", - "/w44062", - "/w44242", - "/w14905", - "/w14906", - "/w14263", - "/w44265", - "/w14928" - ], - "C_Cpp_Runner.enableWarnings": true, - "C_Cpp_Runner.warningsAsError": false, - "C_Cpp_Runner.compilerArgs": [], - "C_Cpp_Runner.linkerArgs": [], - "C_Cpp_Runner.includePaths": [], - "C_Cpp_Runner.includeSearch": [ - "*", - "**/*" - ], - "C_Cpp_Runner.excludeSearch": [ - "**/build", - "**/build/**", - "**/.*", - "**/.*/**", - "**/.vscode", - "**/.vscode/**" - ], - "C_Cpp_Runner.useAddressSanitizer": false, - "C_Cpp_Runner.useUndefinedSanitizer": false, - "C_Cpp_Runner.useLeakSanitizer": false, - "C_Cpp_Runner.showCompilationTime": false, - "C_Cpp_Runner.useLinkTimeOptimization": false, - "C_Cpp_Runner.msvcSecureNoWarnings": false, - "cmake.sourceDirectory": "D:/Git/iot-firmware/.pio/libdeps/full/Adafruit BusIO" -} \ No newline at end of file diff --git a/src/ota_html/ota-part3.html b/src/ota_html/ota-part3.html index 4826dbf..b9b4dd4 100644 --- a/src/ota_html/ota-part3.html +++ b/src/ota_html/ota-part3.html @@ -23,7 +23,7 @@ R"=====(