This file contains a very basic SNTP client. More...
#include <std.h>
#include <clk.h>
#include <tsk.h>
#include "lwip/sockets.h"
#include "lwip/netdb.h"
#include "sockets_inline.h"
#include "net/clients/sntp.h"
Functions | |
int | SNTPGetTime (const char *apServer, time_t *apTime, struct timeval *apTimeOut, sntpframe *apData) |
This file contains a very basic SNTP client.
o 0 | / Copyright (c) 2006-2007 (CL)---o Critical Link, LLC \ O
int SNTPGetTime | ( | const char * | apServer, | |
time_t * | apTime, | |||
struct timeval * | apTimeOut, | |||
sntpframe * | apData | |||
) |
This routine is used to issue a request to a time server. The address of the server is provided (dotted IP notation), as well as storage for the resulting time_t value. A timeout (in OS ticks) is also required. Optional storage may also be provided for the entire response from the time server to be returned to the caller.
[in] | apServer | The server IP address (w.x.y.z) |
[out] | apTime | Returned time (seconds since 1/1/1900) |
[in] | apTimeOut | Ticks to wait for SNTP completion |
[out] | apData | Pointer to storage for SNTP response (may be NULL) |