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

udp/ntp/ntpclient.h

Committer:
andrewboyson
Date:
2020-04-02
Revision:
167:3ba4e3c49631
Parent:
160:6a1d1d368f80

File content as of revision 167:3ba4e3c49631:

#include <stdbool.h>
#include <stdint.h>
#include "ntp.h"

extern bool     NtpClientTrace;
extern void     NtpClientInit(void);
extern void     NtpClientTimeUpdateSuccessful(void);

extern int32_t  NtpClientReplyOffsetMs;
extern int32_t  NtpClientReplyMaxDelayMs;
extern void     NtpClientReply(void (*traceback)(void), char* pPacket);

extern uint64_t NtpClientQueryTime;

extern char     NtpClientQueryServerName[];
extern int32_t  NtpClientQueryInitialInterval;
extern int32_t  NtpClientQueryNormalInterval;
extern int32_t  NtpClientQueryRetryInterval;

extern bool     NtpClientQuerySendRequestsViaIp4;
extern uint32_t NtpClientQueryServerIp4;
extern char     NtpClientQueryServerIp6[];

extern void     NtpClientQueryStartInterval(int type);
extern int      NtpClientQueryPoll(int type, char* pPacket, int* pSize);

enum {
    NTP_QUERY_INTERVAL_INITIAL,
    NTP_QUERY_INTERVAL_NORMAL,
    NTP_QUERY_INTERVAL_RETRY
};