Simple Network Time Protocol

Simple Network Time Protocol (SNTP) implementation. More...

Detailed Description

Simple Network Time Protocol (SNTP) implementation.

Files

file  sntp.h
 SNTP definitions.
 

Functions

int sntp_sync (sock_udp_ep_t *server, uint32_t timeout)
 Synchronize with time server. More...
 
int64_t sntp_get_offset (void)
 Get real time offset from system time as returned by xtimer_now64() More...
 
static uint64_t sntp_get_unix_usec (void)
 Get time in microseconds from 1970-01-01 00:00:00 UTC. More...
 

Function Documentation

◆ sntp_get_offset()

int64_t sntp_get_offset ( void  )

Get real time offset from system time as returned by xtimer_now64()

Returns
Real time offset in microseconds relative to 1900-01-01 00:00 UTC

◆ sntp_get_unix_usec()

static uint64_t sntp_get_unix_usec ( void  )
inlinestatic

Get time in microseconds from 1970-01-01 00:00:00 UTC.

Returns
Time in microseconds from 1970-01-01 00:00:00 UTC

Definition at line 60 of file sntp.h.

◆ sntp_sync()

int sntp_sync ( sock_udp_ep_t server,
uint32_t  timeout 
)

Synchronize with time server.

Parameters
[in]serverThe time server
[in]timeoutTimeout for the server response in microseconds
Returns
0 on success
Negative number on error