Fork of the excellent esp8266-react - https://github.com/rjwats/esp8266-react
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
883 B
37 lines
883 B
#include <FeaturesService.h>
|
|
|
|
FeaturesService::FeaturesService(AsyncWebServer* server) {
|
|
server->on(FEATURES_SERVICE_PATH, HTTP_GET, std::bind(&FeaturesService::features, this, std::placeholders::_1));
|
|
}
|
|
|
|
void FeaturesService::features(AsyncWebServerRequest* request) {
|
|
AsyncJsonResponse* response = new AsyncJsonResponse(false, MAX_FEATURES_SIZE);
|
|
JsonObject root = response->getRoot();
|
|
#if FT_ENABLED(FT_PROJECT)
|
|
root["project"] = true;
|
|
#else
|
|
root["project"] = false;
|
|
#endif
|
|
#if FT_ENABLED(FT_SECURITY)
|
|
root["security"] = true;
|
|
#else
|
|
root["security"] = false;
|
|
#endif
|
|
#if FT_ENABLED(FT_MQTT)
|
|
root["mqtt"] = true;
|
|
#else
|
|
root["mqtt"] = false;
|
|
#endif
|
|
#if FT_ENABLED(FT_NTP)
|
|
root["ntp"] = true;
|
|
#else
|
|
root["ntp"] = false;
|
|
#endif
|
|
#if FT_ENABLED(FT_OTA)
|
|
root["ota"] = true;
|
|
#else
|
|
root["ota"] = false;
|
|
#endif
|
|
response->setLength();
|
|
request->send(response);
|
|
}
|