Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.
NtpClient Class Reference
Inheritance diagram for NtpClient:
UdpConnection

Public Member Functions

 NtpClient (NtpTimeResultDelegate onTimeReceivedCb)
 
 NtpClient (String reqServer, int reqIntervalSeconds, NtpTimeResultDelegate onTimeReceivedCb=nullptr)
 
void requestTime ()
 
void setNtpServer (String server)
 
void setAutoQuery (bool autoQuery)
 
void setAutoQueryInterval (int seconds)
 
void setAutoUpdateSystemClock (bool autoUpdateClock)
 

Protected Member Functions

void onReceive (pbuf *buf, IPAddress remoteIP, uint16_t remotePort)
 
void internalRequestTime (IPAddress serverIp)
 
- Protected Member Functions inherited from UdpConnection
void initialize (udp_pcb *pcb=NULL)
 
 UdpConnection (UdpConnectionDataDelegate dataHandler)
 
virtual bool listen (int port)
 
virtual bool connect (IPAddress ip, uint16_t port)
 
virtual void close ()
 
virtual void send (const char *data, int length)
 
void sendString (const char *data)
 
void sendString (const String data)
 
virtual void sendTo (IPAddress remoteIP, uint16_t remotePort, const char *data, int length)
 
void sendStringTo (IPAddress remoteIP, uint16_t remotePort, const char *data)
 
void sendStringTo (IPAddress remoteIP, uint16_t remotePort, const String data)
 

Static Protected Member Functions

static void staticDnsResponse (const char *name, struct ip_addr *ip, void *arg)
 
- Static Protected Member Functions inherited from UdpConnection
static void staticOnReceive (void *arg, struct udp_pcb *pcb, struct pbuf *p, struct ip_addr *addr, u16_t port)
 

Protected Attributes

String server = NTP_DEFAULT_SERVER
 
NtpTimeResultDelegate delegateCompleted = nullptr
 
bool autoUpdateSystemClock = false
 
Timer autoUpdateTimer
 
Timer timeoutTimer
 
Timer connectionTimer
 
- Protected Attributes inherited from UdpConnection
udp_pcb * udp
 
UdpConnectionDataDelegate onDataCallback