From 4e76bd086663e46a73ed564e30444610583d60f1 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Thu, 19 Sep 2019 10:10:00 +0200 Subject: [PATCH] Fixing function signature error of 'NTPClient(UDP& udp, const char* poolServerName, long timeOffset)' (long timeOffset instead of int timeOffset) and adding the overloaded ctors also for an IPAddress --- NTPClient.cpp | 19 +++++++++++++++++-- NTPClient.h | 4 +++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/NTPClient.cpp b/NTPClient.cpp index f2d484f..b4f73e5 100755 --- a/NTPClient.cpp +++ b/NTPClient.cpp @@ -37,16 +37,23 @@ NTPClient::NTPClient(UDP& udp, const char* poolServerName) { NTPClient::NTPClient(UDP& udp, IPAddress poolServerIP) { this->_udp = &udp; - this->_poolServerIP = poolServerIP; + this->_poolServerIP = poolServerIP; this->_poolServerName = NULL; } -NTPClient::NTPClient(UDP& udp, const char* poolServerName, int timeOffset) { +NTPClient::NTPClient(UDP& udp, const char* poolServerName, long timeOffset) { this->_udp = &udp; this->_timeOffset = timeOffset; this->_poolServerName = poolServerName; } +NTPClient::NTPClient(UDP& udp, IPAddress poolServerIP, long timeOffset){ + this->_udp = &udp; + this->_timeOffset = timeOffset; + this->_poolServerIP = poolServerIP; + this->_poolServerName = NULL; +} + NTPClient::NTPClient(UDP& udp, const char* poolServerName, long timeOffset, unsigned long updateInterval) { this->_udp = &udp; this->_timeOffset = timeOffset; @@ -54,6 +61,14 @@ NTPClient::NTPClient(UDP& udp, const char* poolServerName, long timeOffset, unsi this->_updateInterval = updateInterval; } +NTPClient::NTPClient(UDP& udp, IPAddress poolServerIP, long timeOffset, unsigned long updateInterval) { + this->_udp = &udp; + this->_timeOffset = timeOffset; + this->_poolServerIP = poolServerIP; + this->_poolServerName = NULL; + this->_updateInterval = updateInterval; +} + void NTPClient::begin() { this->begin(NTP_DEFAULT_LOCAL_PORT); } diff --git a/NTPClient.h b/NTPClient.h index 08c6ee1..5a8c96c 100755 --- a/NTPClient.h +++ b/NTPClient.h @@ -30,9 +30,11 @@ class NTPClient { NTPClient(UDP& udp); NTPClient(UDP& udp, long timeOffset); NTPClient(UDP& udp, const char* poolServerName); - NTPClient(UDP& udp, IPAddress poolServerIP); NTPClient(UDP& udp, const char* poolServerName, long timeOffset); NTPClient(UDP& udp, const char* poolServerName, long timeOffset, unsigned long updateInterval); + NTPClient(UDP& udp, IPAddress poolServerIP); + NTPClient(UDP& udp, IPAddress poolServerIP, long timeOffset); + NTPClient(UDP& udp, IPAddress poolServerIP, long timeOffset, unsigned long updateInterval); /** * Set time server name