trying to make telnetserver repo public
Fork of NTPClient_NetServices by
Revision 1:1f436e56925f, committed 2010-06-18
- Comitter:
- donatien
- Date:
- Fri Jun 18 09:21:27 2010 +0000
- Parent:
- 0:de37f60b4d0f
- Child:
- 2:88b9b7173dba
- Commit message:
Changed in this revision
Binary file LPC1768/NTPClient.ar has changed
--- a/LPC1768/dbg/dbg.h Fri Jun 11 16:27:11 2010 +0000 +++ b/LPC1768/dbg/dbg.h Fri Jun 18 09:21:27 2010 +0000 @@ -39,21 +39,26 @@ public: static void debug(const char* format, ...); static void release(); +static void breakPoint(const char* file, int line); private: }; #undef DBG #undef DBG_END +#undef BREAK #define DBG DebugStream::debug #define DBG_END DebugStream::release +#define BREAK() DebugStream::breakPoint(__FILE__, __LINE__) #endif #else #undef DBG #undef DBG_END +#undef BREAK #define DBG(...) #define DBG_END() +#define BREAK() #endif #ifdef __LWIP_DEBUG
--- a/LPC1768/services/ntp/NTPClient.h Fri Jun 11 16:27:11 2010 +0000 +++ b/LPC1768/services/ntp/NTPClient.h Fri Jun 18 09:21:27 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;
Binary file LPC2368/NTPClient.ar has changed
--- a/LPC2368/dbg/dbg.h Fri Jun 11 16:27:11 2010 +0000 +++ b/LPC2368/dbg/dbg.h Fri Jun 18 09:21:27 2010 +0000 @@ -39,21 +39,26 @@ public: static void debug(const char* format, ...); static void release(); +static void breakPoint(const char* file, int line); private: }; #undef DBG #undef DBG_END +#undef BREAK #define DBG DebugStream::debug #define DBG_END DebugStream::release +#define BREAK() DebugStream::breakPoint(__FILE__, __LINE__) #endif #else #undef DBG #undef DBG_END +#undef BREAK #define DBG(...) #define DBG_END() +#define BREAK() #endif #ifdef __LWIP_DEBUG
--- a/LPC2368/services/ntp/NTPClient.h Fri Jun 11 16:27:11 2010 +0000 +++ b/LPC2368/services/ntp/NTPClient.h Fri Jun 18 09:21:27 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;