Added support for server IPAddress argument to NTPClient

This commit is contained in:
sheffieldnick 2017-04-26 15:14:37 +01:00 committed by Alexander Entinger
parent 18d4ac7eb1
commit 931c471697
2 changed files with 8 additions and 1 deletions

8
NTPClient.cpp Normal file → Executable file
View File

@ -35,7 +35,13 @@ NTPClient::NTPClient(UDP& udp, const char* poolServerName) {
this->_poolServerName = poolServerName;
}
NTPClient::NTPClient(UDP& udp, const char* poolServerName, long timeOffset) {
NTPClient::NTPClient(UDP& udp, IPAddress poolServerIP) {
this->_udp = &udp;
this->_poolServerIP = poolServerIP;
this->_poolServerName = NULL;
}
NTPClient::NTPClient(UDP& udp, const char* poolServerName, int timeOffset) {
this->_udp = &udp;
this->_timeOffset = timeOffset;
this->_poolServerName = poolServerName;

1
NTPClient.h Normal file → Executable file
View File

@ -30,6 +30,7 @@ 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);