timezone support

This commit is contained in:
Paul
2019-11-01 15:04:17 +01:00
parent 905ae885f7
commit 6275245b03
14 changed files with 642 additions and 136 deletions

View File

@@ -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;