From ab5d7ac9f884d2d0480644b8167f72f29af1eedc Mon Sep 17 00:00:00 2001 From: Sandeep Mistry Date: Tue, 12 Apr 2016 10:45:21 -0400 Subject: [PATCH] Add end() API --- NTPClient.cpp | 4 ++++ NTPClient.h | 5 +++++ keywords.txt | 1 + 3 files changed, 10 insertions(+) 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