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