| 590 | } |
| 591 | |
| 592 | esp_err_t systemInfoHandler(httpd_req_t *req) { |
| 593 | char response_body[300]; |
| 594 | uint64_t SDTotalBytes = SDM.totalBytes(); |
| 595 | uint64_t SDUsedBytes = SDM.usedBytes(); |
| 596 | sprintf( |
| 597 | response_body, |
| 598 | "{\"%s\":\"%s\",\"SD\":{\"%s\":\"%s\",\"%s\":\"%s\",\"%s\":\"%s\"}}", |
| 599 | "VERSION", |
| 600 | LAUNCHER, |
| 601 | "free", |
| 602 | humanReadableSize(SDTotalBytes - SDUsedBytes).c_str(), |
| 603 | "used", |
| 604 | humanReadableSize(SDUsedBytes).c_str(), |
| 605 | "total", |
| 606 | humanReadableSize(SDTotalBytes).c_str() |
| 607 | ); |
| 608 | sendText(req, "application/json", response_body); |
| 609 | return ESP_OK; |
| 610 | } |
| 611 | |
| 612 | esp_err_t rebootHandler(httpd_req_t *req) { |
| 613 | if (checkUserWebAuth(req)) { |
nothing calls this directly
no test coverage detected