Simple Network Time Protocol

Simple Network Time Protocol (SNTP) implementation.

int sntp_sync(sock/udp.h::sock_udp_ep_t * server, uint32_t timeout)

Synchronize with time server.

Parameters

server:The time server
timeout:Timeout for the server response in microseconds

Return values

  • 0 on success
  • Negative number on error
int64_t sntp_get_offset(void)

Get real time offset from system time as returned by xtimer.h::xtimer_now64()

Return values

  • Real time offset in microseconds relative to 1900-01-01 00:00 UTC
uint64_t sntp_get_unix_usec(void)

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

Return values

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