diff --git a/src/app/webApi.cpp b/src/app/webApi.cpp index 130cdba..92acecd 100644 --- a/src/app/webApi.cpp +++ b/src/app/webApi.cpp @@ -138,3 +138,31 @@ boolean espResetApi(WEBServerManager::HttpRequestData &HRD, WiFiClient *wc, void return true; } +boolean sdCardSizeApi(WEBServerManager::HttpRequestData &HRD, WiFiClient *wc, void *pData) +{ + SAB *p = (SAB *)pData; + char buffer[200]; + double size = p->getSdCardManager().getSize(GBYTE); + if(size == 0.0) + sprintf(buffer,"HTTP/1.1 200 OK\r\nContent-Type: application/json\r\n\r\n{ \"status\" : \"ok\", \"card\" : \"not present\", \"size\" : \"0\" }"); + else + sprintf(buffer,"HTTP/1.1 200 OK\r\nContent-Type: application/json\r\n\r\n{ \"status\" : \"ok\", \"card\" : \"present\", \"size\" : \"%.2f\", \"unit\" : \"GByte\" }",size); + + wc->print(buffer); + return true; +} + +boolean powerInfoApi(WEBServerManager::HttpRequestData &HRD, WiFiClient *wc, void *pData) +{ + SAB *p = (SAB *)pData; + + return true; +} + +boolean wifiInfoApi(WEBServerManager::HttpRequestData &HRD, WiFiClient *wc, void *pData) +{ + SAB *p = (SAB *)pData; + + return true; +} + diff --git a/src/app/webApi.h b/src/app/webApi.h index 932dfa9..3a7fbbe 100644 --- a/src/app/webApi.h +++ b/src/app/webApi.h @@ -7,8 +7,11 @@ boolean nextViewApi(WEBServerManager::HttpRequestData&, WiFiClient*, void*); boolean ViewByUIDApi(WEBServerManager::HttpRequestData&, WiFiClient*, void*); boolean rtcGetTimeApi(WEBServerManager::HttpRequestData&, WiFiClient*, void*); boolean rtcSetTimeApi(WEBServerManager::HttpRequestData&, WiFiClient*, void*); +boolean sdCardSizeApi(WEBServerManager::HttpRequestData&, WiFiClient*, void*); boolean sdCardUnmountApi(WEBServerManager::HttpRequestData&, WiFiClient*, void*); boolean sdCardMountApi(WEBServerManager::HttpRequestData&, WiFiClient*, void*); +boolean powerInfoApi(WEBServerManager::HttpRequestData&, WiFiClient*, void*); +boolean wifiInfoApi(WEBServerManager::HttpRequestData&, WiFiClient*, void*); boolean espRestartApi(WEBServerManager::HttpRequestData&, WiFiClient*, void*); boolean espResetApi(WEBServerManager::HttpRequestData&, WiFiClient*, void*);