MCPcopy Create free account
hub / github.com/bmorcelli/Launcher / systemInfoHandler

Function systemInfoHandler

src/webInterface.cpp:592–610  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

590}
591
592esp_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
612esp_err_t rebootHandler(httpd_req_t *req) {
613 if (checkUserWebAuth(req)) {

Callers

nothing calls this directly

Calls 2

sendTextFunction · 0.85
humanReadableSizeFunction · 0.70

Tested by

no test coverage detected