Skip to content

Commit

Permalink
Fixing function signature error of 'NTPClient(UDP& udp, const char* p…
Browse files Browse the repository at this point in the history
…oolServerName, long timeOffset)' (long timeOffset instead of int timeOffset) and adding the overloaded ctors also for an IPAddress
  • Loading branch information
aentinger committed Sep 19, 2019
1 parent 931c471 commit 4e76bd0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
19 changes: 17 additions & 2 deletions NTPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,38 @@ 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;
this->_poolServerName = poolServerName;
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);
}
Expand Down
4 changes: 3 additions & 1 deletion NTPClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4e76bd0

Please # to comment.