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