diff --git a/NTPClient.cpp b/NTPClient.cpp index 3014718..76e030b 100644 --- a/NTPClient.cpp +++ b/NTPClient.cpp @@ -119,6 +119,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 0af383b..c14af9f 100644 --- a/NTPClient.h +++ b/NTPClient.h @@ -56,4 +56,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