mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-09 17:29:50 +03:00
timezone support
This commit is contained in:
16
src/Ntp.h
16
src/Ntp.h
@@ -10,18 +10,24 @@
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <ESPAsyncUDP.h>
|
||||
|
||||
#include "TimeLib.h" // customized version of the time library
|
||||
#include "TimeLib.h" // customized version of the Time library
|
||||
#include "Timezone.h"
|
||||
|
||||
#define NTP_PACKET_SIZE 48 // NTP time is in the first 48 bytes of message
|
||||
#define NTP_INTERVAL_DEFAULT 60 // every hour
|
||||
#define NTP_TIMEZONE_DEFAULT 2 // CE
|
||||
#define NTP_TIMEZONE_MAX 9
|
||||
|
||||
class NtpClient {
|
||||
public:
|
||||
void ICACHE_FLASH_ATTR Ntp(const char * server, time_t syncMins);
|
||||
void ICACHE_FLASH_ATTR Ntp(const char * server, time_t syncMins, uint8_t tz_index);
|
||||
ICACHE_FLASH_ATTR virtual ~NtpClient();
|
||||
|
||||
static char * TimeServerName;
|
||||
static IPAddress timeServer;
|
||||
static time_t syncInterval;
|
||||
static char * TimeServerName;
|
||||
static IPAddress timeServer;
|
||||
static time_t syncInterval;
|
||||
static Timezone * tz;
|
||||
static TimeChangeRule * tcr;
|
||||
|
||||
static AsyncUDP udpListener;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user