|
@@ -396,14 +396,6 @@ static void handleRoot() {
|
|
|
httpServer.send(200, "text/html; charset=utf-8", html);
|
|
httpServer.send(200, "text/html; charset=utf-8", html);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static void handleStatus() {
|
|
|
|
|
- String s;
|
|
|
|
|
- s += "uploadActive="; s += (uploadActive ? "1" : "0"); s += "\n";
|
|
|
|
|
- s += "uploadFailed="; s += (uploadFailed ? "1" : "0"); s += "\n";
|
|
|
|
|
- s += "uploadBytes="; s += String((uint32_t)uploadBytes); s += "\n";
|
|
|
|
|
- s += "uploadCRC32=0x"; s += String((uint32_t)uploadCrc, HEX); s += "\n";
|
|
|
|
|
- httpServer.send(200, "text/plain", s);
|
|
|
|
|
-}
|
|
|
|
|
|
|
|
|
|
static void handleUploadDone() {
|
|
static void handleUploadDone() {
|
|
|
if (uploadFailed) {
|
|
if (uploadFailed) {
|
|
@@ -759,7 +751,7 @@ void setup() {
|
|
|
|
|
|
|
|
tcpServer.begin();
|
|
tcpServer.begin();
|
|
|
httpServer.on("/", HTTP_GET, handleRoot);
|
|
httpServer.on("/", HTTP_GET, handleRoot);
|
|
|
- httpServer.on("/status", HTTP_GET, handleStatus);
|
|
|
|
|
|
|
+
|
|
|
httpServer.on("/upload", HTTP_POST, handleUploadDone, handleUploadStream);
|
|
httpServer.on("/upload", HTTP_POST, handleUploadDone, handleUploadStream);
|
|
|
httpServer.on("/ota", HTTP_GET, handleOtaPage);
|
|
httpServer.on("/ota", HTTP_GET, handleOtaPage);
|
|
|
httpServer.on("/ota_do", HTTP_POST, handleOtaDone, handleOtaStream);
|
|
httpServer.on("/ota_do", HTTP_POST, handleOtaDone, handleOtaStream);
|