add spiffs size + formatting

This commit is contained in:
Raomin
2020-05-22 02:06:13 +02:00
parent bcb1098402
commit ce8929fd39
3 changed files with 27 additions and 4 deletions

View File

@ -1,4 +1,9 @@
#include <SystemStatus.h>
#ifdef ESP32
#include <SPIFFS.h>
#elif defined(ESP8266)
#include <FS.h>
#endif
SystemStatus::SystemStatus(AsyncWebServer* server, SecurityManager* securityManager) {
server->on(SYSTEM_STATUS_SERVICE_PATH,
@ -24,6 +29,8 @@ void SystemStatus::systemStatus(AsyncWebServerRequest* request) {
root["sdk_version"] = ESP.getSdkVersion();
root["flash_chip_size"] = ESP.getFlashChipSize();
root["flash_chip_speed"] = ESP.getFlashChipSpeed();
root["spiffs_used"] = SPIFFS.usedBytes();
root["spiffs_size"] = SPIFFS.totalBytes();
response->setLength();
request->send(response);
}