| 542 | } |
| 543 | |
| 544 | esp_err_t otaHandler(httpd_req_t *req) { |
| 545 | if (!checkUserWebAuth(req)) return ESP_OK; |
| 546 | WebParamMap params = readParams(req); |
| 547 | if (params.has("update")) { |
| 548 | update = true; |
| 549 | sendText(req, "text/plain", "Update"); |
| 550 | return ESP_OK; |
| 551 | } |
| 552 | if (params.has("command")) { |
| 553 | command = params.get("command").toInt(); |
| 554 | if (params.has("size")) { |
| 555 | file_size = params.get("size").toInt(); |
| 556 | if (file_size > 0) { |
| 557 | update = true; |
| 558 | runOnce = true; |
| 559 | sendText(req, "text/plain", "OK"); |
| 560 | return ESP_OK; |
| 561 | } |
| 562 | } |
| 563 | } |
| 564 | sendText(req, 400, "text/plain", "Invalid OTA request"); |
| 565 | return ESP_OK; |
| 566 | } |
| 567 | |
| 568 | esp_err_t otaFileHandler(httpd_req_t *req) { |
| 569 | streamMultipartUpload(req); |
nothing calls this directly
no test coverage detected