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.

31 lines
622 B

  1. #ifndef NTPStatus_h
  2. #define NTPStatus_h
  3. #include <time.h>
  4. #ifdef ESP32
  5. #include <WiFi.h>
  6. #include <AsyncTCP.h>
  7. #include <lwip/apps/sntp.h>
  8. #elif defined(ESP8266)
  9. #include <ESP8266WiFi.h>
  10. #include <ESPAsyncTCP.h>
  11. #include <sntp.h>
  12. #endif
  13. #include <ArduinoJson.h>
  14. #include <AsyncJson.h>
  15. #include <ESPAsyncWebServer.h>
  16. #include <SecurityManager.h>
  17. #define MAX_NTP_STATUS_SIZE 1024
  18. #define NTP_STATUS_SERVICE_PATH "/rest/ntpStatus"
  19. class NTPStatus {
  20. public:
  21. NTPStatus(AsyncWebServer* server, SecurityManager* securityManager);
  22. private:
  23. void ntpStatus(AsyncWebServerRequest* request);
  24. };
  25. #endif // end NTPStatus_h