Skip to content

Commit

Permalink
added method for changing time server
Browse files Browse the repository at this point in the history
  • Loading branch information
Peeter Normak authored and sandeepmistry committed Jun 27, 2018
1 parent 1012521 commit 6bb8cda
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions NTPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ void NTPClient::setUpdateInterval(unsigned long updateInterval) {
this->_updateInterval = updateInterval;
}

void NTPClient::setPoolServerName(const char* poolServerName) {
this->_poolServerName = poolServerName;
}

void NTPClient::sendNTPPacket() {
// set all bytes in the buffer to 0
memset(this->_packetBuffer, 0, NTP_PACKET_SIZE);
Expand Down
7 changes: 7 additions & 0 deletions NTPClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ class NTPClient {
NTPClient(UDP& udp, const char* poolServerName, long timeOffset);
NTPClient(UDP& udp, const char* poolServerName, long timeOffset, unsigned long updateInterval);

/**
* Set time server name
*
* @param poolServerName
*/
void setPoolServerName(const char* poolServerName);

/**
* Starts the underlying UDP client with the default local port
*/
Expand Down

0 comments on commit 6bb8cda

Please sign in to comment.