This module includes functions that control SNTP communication.
More...
This module includes functions that control SNTP communication.
§ OT_SNTP_DEFAULT_SERVER_IP
| #define OT_SNTP_DEFAULT_SERVER_IP "2001:4860:4806:8::" |
§ OT_SNTP_DEFAULT_SERVER_PORT
| #define OT_SNTP_DEFAULT_SERVER_PORT 123 |
§ otSntpQuery
This structure implements SNTP Query parameters.
§ otSntpResponseHandler
| typedef void(* otSntpResponseHandler) (void *aContext, uint64_t aTime, otError aResult) |
This function pointer is called when a SNTP response is received.
- Parameters
-
| [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. |
- Return values
-
| OT_ERROR_NONE | A response was received successfully and time is provided in aTime. |
| OT_ERROR_ABORT | A SNTP transaction was aborted by stack. |
| OT_ERROR_BUSY | The Kiss-o'-death packet has been received. |
| OT_ERROR_RESPONSE_TIMEOUT | No SNTP response has been received within timeout. |
| OT_ERROR_FAILED | A response was received but contains incorrect data. |
§ otSntpClientQuery()
This function sends a SNTP query.
This function is available only if feature OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE is enabled.
- Parameters
-
| [in] | aInstance | A pointer to an OpenThread instance. |
| [in] | aQuery | A pointer to specify SNTP query parameters. |
| [in] | aHandler | A function pointer that shall be called on response reception or time-out. |
| [in] | aContext | A pointer to arbitrary context information. |
Referenced by Interpreter::SetUserCommands().
§ otSntpClientSetUnixEra()
| void otSntpClientSetUnixEra |
( |
otInstance * |
aInstance, |
|
|
uint32_t |
aUnixEra |
|
) |
| |
This function sets the unix era number.
The default value of unix era is set to 0. The subsequent eras start after year 2106.
- Parameters
-
| [in] | aInstance | A pointer to an OpenThread instance. |
| [in] | aUnixEra | Unix era number. |