NtpClient.h
Go to the documentation of this file.
31 #define NTP_DEFAULT_AUTOQUERY_SECONDS 30U // (10U * SECS_PER_MIN) ///< Refresh time if autoupdate set
64 NtpClient(const String& reqServer, unsigned reqIntervalSeconds, NtpTimeResultDelegate onTimeReceivedCb = nullptr);
bool setIntervalMs(uint32_t milliseconds)
Set timer interval in milliseconds.
Definition: CallbackTimer.h:378
A class to make it easier to handle and pass around IP addresses.
Definition: IpAddress.h:45
bool autoUpdateSystemClock
True to update system clock with NTP time.
Definition: NtpClient.h:130
void setNtpServer(const String &server)
Set the NTP server.
Definition: NtpClient.h:74
void onReceive(pbuf *buf, IpAddress remoteIP, uint16_t remotePort) override
Handle UDP message reception.
NtpClient(const String &reqServer, unsigned reqIntervalSeconds, NtpTimeResultDelegate onTimeReceivedCb=nullptr)
Instantiates NTP client object.
NtpClient(NtpTimeResultDelegate onTimeReceivedCb)
Instantiates NTP client object.
Definition: NtpClient.h:54
void startTimer(uint32_t milliseconds)
Start the timer running.
Definition: NtpClient.h:113
void internalRequestTime(IpAddress serverIp)
Send time request to NTP server.
NtpTimeResultDelegate delegateCompleted
NTP result handler delegate.
Definition: NtpClient.h:129
void setAutoUpdateSystemClock(bool autoUpdateClock)
Enable / disable update of system clock.
Definition: NtpClient.h:92
Timer timer
Deals with timeouts, retries and autoquery updates.
Definition: NtpClient.h:133
Definition: UdpConnection.h:28