Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Simple Network Time Protocol Server API. More...

Functions

void sntp_server_clock_source (const uint8_t ref_id[4], uint8_t stratum, int8_t precision)
 Set SNTP time source id, stratum and precision.

Detailed Description

Simple Network Time Protocol Server API.

Since
4.5
Version
0.1.0

Function Documentation

◆ sntp_server_clock_source()

void sntp_server_clock_source ( const uint8_t ref_id[4],
uint8_t stratum,
int8_t precision )

#include <sntp_server.h>

Set SNTP time source id, stratum and precision.

Until this function is called, the server answers queries with the leap indicator set to "clock not synchronized" and stratum 16, telling clients that its time must not be used. Call it after the system clock has been set to a trusted time.

Parameters
ref_idthe reference ID (RFC5905, Fig.12)
stratumindicating the stratum of the clock source
precisionan exponent of two, where the resulting value is the precision of the system clock in seconds.