lcd upload endpoint

This commit is contained in:
Siwat Sirichai 2023-11-13 15:31:50 +07:00
parent 91fb96f596
commit d056e6fa7b
2 changed files with 15 additions and 1 deletions

View File

@ -15,6 +15,7 @@
"*.d": "cpp",
"*.html": "cpp",
"*.tcc": "cpp",
"regex": "cpp"
"regex": "cpp",
"cstdlib": "cpp"
}
}

View File

@ -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<upload.currentSize;i++)
Serial.print(upload.buf[i],HEX);
} else if (upload.status == UPLOAD_FILE_END) {
Serial.println("Upload End");
}
});
otaserver.begin();
}
#endif