diff --git a/NTPClient.cpp b/NTPClient.cpp index f3f73e0..09fe04b 100644 --- a/NTPClient.cpp +++ b/NTPClient.cpp @@ -128,6 +128,10 @@ String NTPClient::getFormattedTime() { return hoursStr + ":" + minuteStr + ":" + secondStr; } +void NTPClient::end() { + this->_udp->stop(); +} + void NTPClient::sendNTPPacket() { // set all bytes in the buffer to 0 memset(this->_packetBuffer, 0, NTP_PACKET_SIZE); diff --git a/NTPClient.h b/NTPClient.h index 2e1b3ca..8ac4077 100644 --- a/NTPClient.h +++ b/NTPClient.h @@ -67,4 +67,9 @@ class NTPClient { * @return time as raw seconds */ unsigned long getRawTime(); + + /** + * Stops the underlying UDP client + */ + void end(); }; diff --git a/keywords.txt b/keywords.txt index d64a538..5570658 100644 --- a/keywords.txt +++ b/keywords.txt @@ -9,6 +9,7 @@ NTPClient KEYWORD1 ####################################### begin KEYWORD2 +end KEYWORD2 update KEYWORD2 forceUpdate KEYWORD2 getDay KEYWORD2