Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: HelloWorld ServoInterfaceBoardExample1 4180_Lab4
Diff: services/ntp/NTPClient.h
- Revision:
- 2:a4f97773c90f
- Parent:
- 0:632c9925f013
- Child:
- 5:dd63a1e02b1b
--- a/services/ntp/NTPClient.h Mon Jun 14 10:33:54 2010 +0000
+++ b/services/ntp/NTPClient.h Fri Jun 18 09:22:54 2010 +0000
@@ -38,7 +38,7 @@
NTP_DNS //Could not resolve DNS Addr
};
-class NTPClient
+class NTPClient : protected NetService
{
public:
NTPClient();
@@ -66,10 +66,15 @@
m_pCbMeth = (void (CDummy::*)(NTPResult)) pMethod;
}
- void init();
void close();
+protected:
+ virtual void poll(); //Called by NetServices
+
private:
+ void init();
+ void open();
+
__packed struct NTPPacket //See RFC 4330 for Simple NTP
{
//WARN: We are in LE! Network is BE!
@@ -119,12 +124,14 @@
NTPStep m_state;
+ NTPPacket m_pkt;
+
CDummy* m_pCbItem;
void (CDummy::*m_pCbMeth)(NTPResult);
void (*m_pCb)(NTPResult);
- Timeout m_watchdog;
+ Timer m_watchdog;
int m_timeout;
bool m_closed;