nRF5 SDK for Thread and Zigbee v2.0.0
Macros | Typedefs | Enumerations | Functions
Network Time Synchronization

This module includes functions that control network time synchronization service. More...

Macros

#define OT_TIME_SYNC_INVALID_SEQ   0
 

Typedefs

typedef enum otNetworkTimeStatus otNetworkTimeStatus
 

Enumerations

enum  otNetworkTimeStatus { OT_NETWORK_TIME_UNSYNCHRONIZED = -1, OT_NETWORK_TIME_RESYNC_NEEDED = 0, OT_NETWORK_TIME_SYNCHRONIZED = 1 }
 

Functions

otNetworkTimeStatus otNetworkTimeGet (otInstance *aInstance, uint64_t &aNetworkTime)
 
otError otNetworkTimeSetSyncPeriod (otInstance *aInstance, uint16_t aTimeSyncPeriod)
 
uint16_t otNetworkTimeGetSyncPeriod (otInstance *aInstance)
 
otError otNetworkTimeSetXtalThreshold (otInstance *aInstance, uint16_t aXTALThreshold)
 
uint16_t otNetworkTimeGetXtalThreshold (otInstance *aInstance)
 

Detailed Description

This module includes functions that control network time synchronization service.

Macro Definition Documentation

#define OT_TIME_SYNC_INVALID_SEQ   0

zero is considered as invalid time synchronization sequence.

Typedef Documentation

This enum represents OpenThread time synchronization status.

Enumeration Type Documentation

This enum 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.

Function Documentation

otNetworkTimeStatus otNetworkTimeGet ( otInstance aInstance,
uint64_t &  aNetworkTime 
)

Get the Thread network time.

Parameters
[in]aInstanceThe OpenThread instance structure.
[in,out]aNetworkTimeThe Thread network time in microseconds.
Returns
The time synchronization status.
uint16_t otNetworkTimeGetSyncPeriod ( otInstance aInstance)

Get the time synchronization period.

Parameters
[in]aInstanceThe OpenThread instance structure.
Returns
The time synchronization period.
uint16_t otNetworkTimeGetXtalThreshold ( otInstance aInstance)

Get the time synchronization XTAL accuracy threshold for Router.

Parameters
[in]aInstanceThe OpenThread instance structure.
Returns
The XTAL accuracy threshold for Router, in PPM.
otError otNetworkTimeSetSyncPeriod ( otInstance aInstance,
uint16_t  aTimeSyncPeriod 
)

Set the time synchronization period.

This function can only be called while Thread protocols are disabled.

Parameters
[in]aInstanceThe OpenThread instance structure.
[in]aTimeSyncPeriodThe time synchronization period, in seconds.
Return values
OT_ERROR_NONESuccessfully set the time sync period.
OT_ERROR_INVALID_STATEThread protocols are enabled.
otError otNetworkTimeSetXtalThreshold ( otInstance aInstance,
uint16_t  aXTALThreshold 
)

Set the time synchronization XTAL accuracy threshold for Router-Capable device.

This function can only be called while Thread protocols are disabled.

Parameters
[in]aInstanceThe OpenThread instance structure.
[in]aXTALThresholdThe XTAL accuracy threshold for Router, in PPM.
Return values
OT_ERROR_NONESuccessfully set the time sync period.
OT_ERROR_INVALID_STATEThread protocols are enabled.

Documentation feedback | Developer Zone | Subscribe | Updated