SNTP#
This module includes functions that control SNTP communication.
Modules#
Typedefs#
Implements SNTP Query parameters.
Pointer is called when a SNTP response is received.
Functions#
Sends a SNTP query.
Sets the unix era number.
Macros#
Defines default SNTP Server address - Google NTP Server.
Defines default SNTP Server port.
Typedef Documentation#
otSntpResponseHandler#
typedef void(* otSntpResponseHandler) (void *aContext, uint64_t aTime, otError aResult) )(void *aContext, uint64_t aTime, otError aResult)
Pointer is called when a SNTP response is received.
Type | Direction | Argument Name | Description |
---|---|---|---|
[in] | aContext | A pointer to application-specific context. | |
[in] | aTime | Specifies the time at the server when the response left for the client, in UNIX time. | |
[in] | aResult | A result of the SNTP transaction. |
Function Documentation#
otSntpClientQuery#
otError otSntpClientQuery (otInstance * aInstance, const otSntpQuery * aQuery, otSntpResponseHandler aHandler, void * aContext)
Sends a SNTP query.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
const otSntpQuery * | [in] | aQuery | A pointer to specify SNTP query parameters. |
otSntpResponseHandler | [in] | aHandler | A function pointer that shall be called on response reception or time-out. |
void * | [in] | aContext | A pointer to arbitrary context information. |
Is available only if feature OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE
is enabled.
otSntpClientSetUnixEra#
void otSntpClientSetUnixEra (otInstance * aInstance, uint32_t aUnixEra)
Sets the unix era number.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint32_t | [in] | aUnixEra | Unix era number. |
The default value of unix era is set to 0. The subsequent eras start after year 2106.