WordClockESP/lib/framework/NTPStatus.h
rjwats ced5b74ba1
NTP Timezone & Enable/Disable Setting (#80)
* quick and dirty WIP to investigate timezones, currently only building under esp8266 platform
much of the status stuff has been stripped for now, to test the concepts

* support set of common features across ESP32/ESP8266 WRT timezone and sntp
return dates as ISO format strings

* remove time library, and timelib fix which is no longer required

* fix the icons

* remove temporary changes to demo project
2020-01-20 11:14:46 +00:00

32 lines
622 B
C++

#ifndef NTPStatus_h
#define NTPStatus_h
#include <time.h>
#ifdef ESP32
#include <WiFi.h>
#include <AsyncTCP.h>
#include <lwip/apps/sntp.h>
#elif defined(ESP8266)
#include <ESP8266WiFi.h>
#include <ESPAsyncTCP.h>
#include <sntp.h>
#endif
#include <ArduinoJson.h>
#include <AsyncJson.h>
#include <ESPAsyncWebServer.h>
#include <SecurityManager.h>
#define MAX_NTP_STATUS_SIZE 1024
#define NTP_STATUS_SERVICE_PATH "/rest/ntpStatus"
class NTPStatus {
public:
NTPStatus(AsyncWebServer* server, SecurityManager* securityManager);
private:
void ntpStatus(AsyncWebServerRequest* request);
};
#endif // end NTPStatus_h