A stack which works with or without an Mbed os library. Provides IPv4 or IPv6 with a full 1500 byte buffer.

Dependents:   oldheating gps motorhome heating

Revision:
113:904b40231907
Parent:
112:f8694d0b8858
Child:
124:6e558721ec1c
--- a/udp/ntp/ntpclient.h	Mon Jan 21 16:58:28 2019 +0000
+++ b/udp/ntp/ntpclient.h	Tue Jan 22 15:41:12 2019 +0000
@@ -1,18 +1,29 @@
 #include <stdbool.h>
+#include <stdint.h>
+#include "ntp.h"
 
-extern char     NtpClientServerName[];
-extern int      NtpClientInitialInterval;
-extern int      NtpClientNormalInterval;
-extern int      NtpClientRetryInterval;
-extern int      NtpClientOffsetMs;
-extern int      NtpClientMaxDelayMs;
+extern bool     NtpClientTrace;
+extern void     NtpClientInit(void);
+extern void     NtpClientTimeUpdateSuccessful(void);
+
+extern int      NtpClientReplyOffsetMs;
+extern int      NtpClientReplyMaxDelayMs;
+extern void     NtpClientReply(void (*traceback)(void), struct NtpHeader* pHeader);
 
-extern bool     NtpClientSendRequestsViaIp4;
-extern bool     NtpClientTrace;
-extern uint32_t NtpClientServerIp4;
-extern char     NtpClientServerIp6[];
+extern char     NtpClientQueryServerName[];
+extern int      NtpClientQueryInitialInterval;
+extern int      NtpClientQueryNormalInterval;
+extern int      NtpClientQueryRetryInterval;
+
+extern bool     NtpClientQuerySendRequestsViaIp4;
+extern uint32_t NtpClientQueryServerIp4;
+extern char     NtpClientQueryServerIp6[];
 
-extern int      NtpClientInit(void);
+extern void     NtpClientQueryStartInterval(int type);
+extern int      NtpClientQueryPoll(int type, void* pPacket, int* pSize);
 
-extern void     NtpClientSetClockTime(uint64_t ori, uint64_t rec, int li);
-extern int      NtpClientPollForPacketToSend(int type, void* pPacket, int* pSize);
\ No newline at end of file
+enum {
+    NTP_QUERY_INTERVAL_INITIAL,
+    NTP_QUERY_INTERVAL_NORMAL,
+    NTP_QUERY_INTERVAL_RETRY
+};