Nut/OS  5.0.5
API Reference
SNTP

Simple network time protocol. More...

Collaboration diagram for SNTP:

Data Structures

struct  _sntpframe
struct  SNTP_resync_args

Defines

#define NUT_THREAD_SNTPSTACK   256
#define NTP_PORT   123
#define SNTP_PORT   NTP_PORT

Typedefs

typedef struct _sntpframe sntpframe

Functions

void SNTP_resync (void *arg)
int NutSNTPGetTime (uint32_t *server_adr, time_t *t)
int NutSNTPStartThread (uint32_t server_addr, uint32_t interval)

Detailed Description

Simple network time protocol.

Todo:
Enhance documentation.

Define Documentation

#define NUT_THREAD_SNTPSTACK   256

Referenced by NutSNTPStartThread().

#define NTP_PORT   123
#define SNTP_PORT   NTP_PORT

Referenced by NutSNTPGetTime().


Typedef Documentation

typedef struct _sntpframe sntpframe

Function Documentation

void SNTP_resync ( void *  arg)

References free(), SNTP_resync_args::interval, NutSleep(), NutSNTPGetTime(), NutThreadSetPriority(), SNTP_resync_args::server_addr, and stime().

Referenced by NutSNTPStartThread().

Here is the call graph for this function:

int NutSNTPGetTime ( uint32_t server_adr,
time_t t 
)

References _DAY_SEC, _LEAP_YEAR_ADJUST, calloc, free(), _sntpframe::mode, ntohl, NULL, NutUdpCreateSocket(), NutUdpDestroySocket(), NutUdpReceiveFrom(), NutUdpSendTo(), NutUdpSetSockOpt(), SNTP_PORT, SO_RCVBUF, and _sntpframe::transmit_ts_sec.

Referenced by main(), and SNTP_resync().

Here is the call graph for this function:

int NutSNTPStartThread ( uint32_t  server_addr,
uint32_t  interval 
)

References free(), SNTP_resync_args::interval, malloc(), NUT_THREAD_SNTPSTACK, NUT_THREAD_STACK_ADD, NUT_THREAD_STACK_MULT, NutThreadCreate(), SNTP_resync_args::server_addr, and SNTP_resync().

Here is the call graph for this function: