Network Time Synchronization#
This module includes functions that control network time synchronization service.
Enumerations#
Represents OpenThread time synchronization status.
Typedefs#
Represents OpenThread time synchronization status.
Pointer is called when a network time sync or status change occurs.
Functions#
Get the Thread network time.
Set the time synchronization period.
Get the time synchronization period.
Set the time synchronization XTAL accuracy threshold for Router-Capable device.
Get the time synchronization XTAL accuracy threshold for Router.
Set a callback to be called when a network time sync or status change occurs.
Macros#
zero is considered as invalid time synchronization sequence.
Enumeration Documentation#
otNetworkTimeStatus#
otNetworkTimeStatus
Represents OpenThread time synchronization status.
Enumerator | |
---|---|
OT_NETWORK_TIME_UNSYNCHRONIZED | The device hasn't attached to a network. |
OT_NETWORK_TIME_RESYNC_NEEDED | The device hasn’t received time sync for more than two periods time. |
OT_NETWORK_TIME_SYNCHRONIZED | The device network time is synchronized. |
59
of file include/openthread/network_time.h
Typedef Documentation#
otNetworkTimeStatus#
typedef enum otNetworkTimeStatus otNetworkTimeStatus
Represents OpenThread time synchronization status.
64
of file include/openthread/network_time.h
otNetworkTimeSyncCallbackFn#
typedef void(* otNetworkTimeSyncCallbackFn) (void *aCallbackContext) )(void *aCallbackContext)
Pointer is called when a network time sync or status change occurs.
70
of file include/openthread/network_time.h
Function Documentation#
otNetworkTimeGet#
otNetworkTimeStatus otNetworkTimeGet (otInstance * aInstance, uint64_t * aNetworkTime)
Get the Thread network time.
[in] | aInstance | The OpenThread instance structure. |
[inout] | aNetworkTime | The Thread network time in microseconds. |
Returns
The time synchronization status.
87
of file include/openthread/network_time.h
otNetworkTimeSetSyncPeriod#
otError otNetworkTimeSetSyncPeriod (otInstance * aInstance, uint16_t aTimeSyncPeriod)
Set the time synchronization period.
[in] | aInstance | The OpenThread instance structure. |
[in] | aTimeSyncPeriod | The time synchronization period, in seconds. |
Can only be called while Thread protocols are disabled.
101
of file include/openthread/network_time.h
otNetworkTimeGetSyncPeriod#
uint16_t otNetworkTimeGetSyncPeriod (otInstance * aInstance)
Get the time synchronization period.
[in] | aInstance | The OpenThread instance structure. |
Returns
The time synchronization period.
111
of file include/openthread/network_time.h
otNetworkTimeSetXtalThreshold#
otError otNetworkTimeSetXtalThreshold (otInstance * aInstance, uint16_t aXTALThreshold)
Set the time synchronization XTAL accuracy threshold for Router-Capable device.
[in] | aInstance | The OpenThread instance structure. |
[in] | aXTALThreshold | The XTAL accuracy threshold for Router, in PPM. |
Can only be called while Thread protocols are disabled.
125
of file include/openthread/network_time.h
otNetworkTimeGetXtalThreshold#
uint16_t otNetworkTimeGetXtalThreshold (otInstance * aInstance)
Get the time synchronization XTAL accuracy threshold for Router.
[in] | aInstance | The OpenThread instance structure. |
Returns
The XTAL accuracy threshold for Router, in PPM.
135
of file include/openthread/network_time.h
otNetworkTimeSyncSetCallback#
void otNetworkTimeSyncSetCallback (otInstance * aInstance, otNetworkTimeSyncCallbackFn aCallbackFn, void * aCallbackContext)
Set a callback to be called when a network time sync or status change occurs.
[in] | aInstance | The OpenThread instance structure. |
[in] | aCallbackFn | The callback function to be called |
[in] | aCallbackContext | The context to be passed to the callback function upon invocation |
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.
148
of file include/openthread/network_time.h