mikroSDK Reference Manual
sntp_client_misc.h
1
31#ifndef _SNTP_CLIENT_MISC_H
32#define _SNTP_CLIENT_MISC_H
33
34//Dependencies
35#include "core/net.h"
36#include "sntp/sntp_client.h"
37
38//C++ guard
39#ifdef __cplusplus
40extern "C" {
41#endif
42
43//SNTP client related functions
44error_t sntpClientOpenConnection(SntpClientContext *context);
45void sntpClientCloseConnection(SntpClientContext *context);
46
47error_t sntpClientSendRequest(SntpClientContext *context);
48error_t sntpClientReceiveResponse(SntpClientContext *context);
49
50error_t sntpClientCheckResponse(SntpClientContext *context,
51 const IpAddr *ipAddr, uint16_t port, const uint8_t *message,
52 size_t length);
53
54error_t sntpClientParseResponse(SntpClientContext *context,
55 NtpTimestamp *timestamp);
56
57error_t sntpClientCheckTimeout(SntpClientContext *context);
58
59void sntpClientDumpMessage(const uint8_t *message, size_t length);
60void sntpClientDumpTimestamp(const NtpTimestamp *timestamp);
61
62//C++ guard
63#ifdef __cplusplus
64}
65#endif
66
67#endif
error_t
Error codes.
Definition error.h:43
TCP/IP stack core.
SNTP client (Simple Network Time Protocol)
IP network address.
Definition ip.h:72
SNTP client context.
Definition sntp_client.h:95