removed timezone, handled via JS

This commit is contained in:
Paul
2019-08-20 19:02:01 +02:00
parent 2e54c48dc4
commit 2aae90b7cf
6 changed files with 25 additions and 33 deletions

View File

@@ -5,17 +5,14 @@
#include "Ntp.h"
char * NtpClient::TimeServerName;
int8_t NtpClient::timezone;
time_t NtpClient::syncInterval;
IPAddress NtpClient::timeServer;
AsyncUDP NtpClient::udpListener;
byte NtpClient::NTPpacket[NTP_PACKET_SIZE];
AsyncUDP NtpClient::udpListener;
byte NtpClient::NTPpacket[NTP_PACKET_SIZE];
void ICACHE_FLASH_ATTR NtpClient::Ntp(const char * server, int8_t tz, time_t syncSecs) {
void ICACHE_FLASH_ATTR NtpClient::Ntp(const char * server, time_t syncMins) {
TimeServerName = strdup(server);
timezone = tz;
syncInterval = syncSecs;
syncInterval = syncMins * 60; // convert to seconds
WiFi.hostByName(TimeServerName, timeServer);
setSyncProvider(getNtpTime);
setSyncInterval(syncInterval);