Network Time Synchronization
This module includes functions that control network time synchronization service.
Summary
Enumerations |
|
---|---|
otNetworkTimeStatus{
|
enum Represents OpenThread time synchronization status. |
Typedefs |
|
---|---|
otNetworkTimeStatus
|
typedefenum otNetworkTimeStatus
Represents OpenThread time synchronization status. |
otNetworkTimeSyncCallbackFn)(void *aCallbackContext)
|
typedefvoid(*
Pointer is called when a network time sync or status change occurs. |
Functions |
|
---|---|
otNetworkTimeGet(otInstance *aInstance, uint64_t *aNetworkTime)
|
Get the Thread network time.
|
otNetworkTimeGetSyncPeriod(otInstance *aInstance)
|
uint16_t
Get the time synchronization period.
|
otNetworkTimeGetXtalThreshold(otInstance *aInstance)
|
uint16_t
Get the time synchronization XTAL accuracy threshold for Router.
|
otNetworkTimeSetSyncPeriod(otInstance *aInstance, uint16_t aTimeSyncPeriod)
|
Set the time synchronization period.
|
otNetworkTimeSetXtalThreshold(otInstance *aInstance, uint16_t aXTALThreshold)
|
Set the time synchronization XTAL accuracy threshold for Router-Capable device.
|
otNetworkTimeSyncSetCallback(otInstance *aInstance, otNetworkTimeSyncCallbackFn aCallbackFn, void *aCallbackContext)
|
void
Set a callback to be called when a network time sync or status change occurs.
|
Macros |
|
---|---|
OT_TIME_SYNC_INVALID_SEQ 0
|
zero is considered as invalid time synchronization sequence.
|
Enumerations
otNetworkTimeStatus
otNetworkTimeStatus
Represents OpenThread time synchronization status.
Typedefs
otNetworkTimeStatus
enum otNetworkTimeStatus otNetworkTimeStatus
Represents OpenThread time synchronization status.
otNetworkTimeSyncCallbackFn
void(* otNetworkTimeSyncCallbackFn)(void *aCallbackContext)
Pointer is called when a network time sync or status change occurs.
Functions
otNetworkTimeGet
otNetworkTimeStatus otNetworkTimeGet( otInstance *aInstance, uint64_t *aNetworkTime )
Get the Thread network time.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
The time synchronization status.
|
otNetworkTimeGetSyncPeriod
uint16_t otNetworkTimeGetSyncPeriod( otInstance *aInstance )
Get the time synchronization period.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The time synchronization period.
|
otNetworkTimeGetXtalThreshold
uint16_t otNetworkTimeGetXtalThreshold( otInstance *aInstance )
Get the time synchronization XTAL accuracy threshold for Router.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The XTAL accuracy threshold for Router, in PPM.
|
otNetworkTimeSetSyncPeriod
otError otNetworkTimeSetSyncPeriod( otInstance *aInstance, uint16_t aTimeSyncPeriod )
Set the time synchronization period.
Can only be called while Thread protocols are disabled.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otNetworkTimeSetXtalThreshold
otError otNetworkTimeSetXtalThreshold( otInstance *aInstance, uint16_t aXTALThreshold )
Set the time synchronization XTAL accuracy threshold for Router-Capable device.
Can only be called while Thread protocols are disabled.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otNetworkTimeSyncSetCallback
void otNetworkTimeSyncSetCallback( otInstance *aInstance, otNetworkTimeSyncCallbackFn aCallbackFn, void *aCallbackContext )
Set a callback to be called when a network time sync or status change occurs.
This callback shall be called only when the network time offset jumps by OPENTHREAD_CONFIG_TIME_SYNC_JUMP_NOTIF_MIN_US or when the status changes.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
Macros
OT_TIME_SYNC_INVALID_SEQ
OT_TIME_SYNC_INVALID_SEQ 0
zero is considered as invalid time synchronization sequence.
Resources
OpenThread API Reference topics originate from the source code, available on GitHub. For more information, or to contribute to our documentation, refer to Resources.