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
40
extern
"C"
{
41
#endif
42
43
//SNTP client related functions
44
error_t
sntpClientOpenConnection(
SntpClientContext
*context);
45
void
sntpClientCloseConnection(
SntpClientContext
*context);
46
47
error_t
sntpClientSendRequest(
SntpClientContext
*context);
48
error_t
sntpClientReceiveResponse(
SntpClientContext
*context);
49
50
error_t
sntpClientCheckResponse(
SntpClientContext
*context,
51
const
IpAddr
*ipAddr, uint16_t port,
const
uint8_t *message,
52
size_t
length);
53
54
error_t
sntpClientParseResponse(
SntpClientContext
*context,
55
NtpTimestamp *timestamp);
56
57
error_t
sntpClientCheckTimeout(
SntpClientContext
*context);
58
59
void
sntpClientDumpMessage(
const
uint8_t *message,
size_t
length);
60
void
sntpClientDumpTimestamp(
const
NtpTimestamp *timestamp);
61
62
//C++ guard
63
#ifdef __cplusplus
64
}
65
#endif
66
67
#endif
error_t
error_t
Error codes.
Definition
error.h:43
net.h
TCP/IP stack core.
sntp_client.h
SNTP client (Simple Network Time Protocol)
IpAddr
IP network address.
Definition
ip.h:72
SntpClientContext
SNTP client context.
Definition
sntp_client.h:95