mirror of
https://github.com/espressif/openthread.git
synced 2026-09-10 11:10:08 +00:00
[ncp] notify host asynchronously upon a significant thread network time change (#3238)
This commit is contained in:
committed by
Jonathan Hui
parent
a5f1ed263d
commit
4f99bcfaf3
@@ -63,6 +63,8 @@ typedef enum otNetworkTimeStatus
|
||||
OT_NETWORK_TIME_SYNCHRONIZED = 1, ///< The device network time is synchronized.
|
||||
} otNetworkTimeStatus;
|
||||
|
||||
typedef void (*otNetworkTimeSyncCallbackFn)(void *aCallbackContext);
|
||||
|
||||
/**
|
||||
* zero is considered as invalid time synchronization sequence.
|
||||
*
|
||||
@@ -128,6 +130,21 @@ otError otNetworkTimeSetXtalThreshold(otInstance *aInstance, uint16_t aXTALThres
|
||||
*/
|
||||
uint16_t otNetworkTimeGetXtalThreshold(otInstance *aInstance);
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @param[in] aInstance The OpenThread instance structure.
|
||||
* @param[in] aCallbackFn The callback function to be called
|
||||
* @param[in] aCallbackContext The context to be passed to the callback function upon invocation
|
||||
*
|
||||
*/
|
||||
void otNetworkTimeSyncSetCallback(otInstance * aInstance,
|
||||
otNetworkTimeSyncCallbackFn aCallbackFn,
|
||||
void * aCallbackContext);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user