2018-02-26 00:11:31 +00:00
|
|
|
#ifndef NTPStatus_h
|
|
|
|
#define NTPStatus_h
|
|
|
|
|
2018-11-11 16:44:29 +00:00
|
|
|
#if defined(ESP8266)
|
|
|
|
#include <ESP8266WiFi.h>
|
|
|
|
#include <ESPAsyncTCP.h>
|
|
|
|
#elif defined(ESP_PLATFORM)
|
|
|
|
#include <WiFi.h>
|
|
|
|
#include <AsyncTCP.h>
|
|
|
|
#endif
|
|
|
|
|
2018-02-26 00:11:31 +00:00
|
|
|
#include <ESPAsyncWebServer.h>
|
|
|
|
#include <ArduinoJson.h>
|
2019-04-14 07:52:40 +00:00
|
|
|
#include <AsyncArduinoJson6.h>
|
2018-02-26 00:11:31 +00:00
|
|
|
#include <TimeLib.h>
|
|
|
|
#include <NtpClientLib.h>
|
2019-05-31 18:58:33 +00:00
|
|
|
#include <SecurityManager.h>
|
2018-02-26 00:11:31 +00:00
|
|
|
|
2019-04-14 07:52:40 +00:00
|
|
|
#define MAX_NTP_STATUS_SIZE 1024
|
2018-04-01 09:35:23 +00:00
|
|
|
#define NTP_STATUS_SERVICE_PATH "/rest/ntpStatus"
|
|
|
|
|
2018-02-26 00:11:31 +00:00
|
|
|
class NTPStatus {
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2019-07-14 21:13:26 +00:00
|
|
|
NTPStatus(SecurityManager* securityManager);
|
|
|
|
void init(AsyncWebServer *server);
|
2018-02-26 00:11:31 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
2019-05-31 18:58:33 +00:00
|
|
|
SecurityManager* _securityManager;
|
2018-02-26 00:11:31 +00:00
|
|
|
void ntpStatus(AsyncWebServerRequest *request);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // end NTPStatus_h
|