Simple Clock#
API and Callbacks for the Simple Clock Component.
Silicon Labs implementation of a simple clock. The component provides time keeping functionality to the framework and the application through implementations of both sl_zigbee_af_get_current_time_cb and sl_zigbee_af_set_time_cb. When the application knows the current time (e.g., by reading the time attribute from a time server), it should call sl_zigbee_af_set_time to keep the component synchronized. The component is not a substitute for an accurate clock and is only intended for use during development. Before production, this component should be replaced with code that provides more accurate time.
API#
Set the time and notes it as synchronized with UTC. The Sync status will be set to SL_ZIGBEE_AF_SIMPLE_CLOCK_UTC_SYNCED.
Retrieve the status of the simple-clock and whether it has been synchronized with UTC via a previous call to sl_zigbee_af_simple_clock_set_utc_synced_time().
Retrieve the current time in seconds, and any millisecond remainder is returned in the passed pointer to the milliseconds value.
Enumerations#
API Documentation#
sl_zigbee_af_simple_clock_set_utc_synced_time#
void sl_zigbee_af_simple_clock_set_utc_synced_time (uint32_t utcTimeSeconds)
Set the time and notes it as synchronized with UTC. The Sync status will be set to SL_ZIGBEE_AF_SIMPLE_CLOCK_UTC_SYNCED.
N/A | utcTimeSeconds | UTC time in seconds |
54
of file app/framework/plugin/simple-clock/simple-clock.h
sl_zigbee_af_simple_clock_get_time_sync_status#
sl_zigbee_af_plugin_simple_clock_time_sync_status_t sl_zigbee_af_simple_clock_get_time_sync_status (void )
Retrieve the status of the simple-clock and whether it has been synchronized with UTC via a previous call to sl_zigbee_af_simple_clock_set_utc_synced_time().
N/A |
Returns
sl_zigbee_af_plugin_simple_clock_time_sync_status_t Simple time sync status
62
of file app/framework/plugin/simple-clock/simple-clock.h
sl_zigbee_af_get_current_time_seconds_with_ms_precision#
uint32_t sl_zigbee_af_get_current_time_seconds_with_ms_precision (uint16_t * millisecondsRemainderReturn)
Retrieve the current time in seconds, and any millisecond remainder is returned in the passed pointer to the milliseconds value.
N/A | millisecondsRemainderReturn | Pointer to variable where the remainder milliseconds will be stored |
Returns
uint32_t Current time in seconds
72
of file app/framework/plugin/simple-clock/simple-clock.h
Enumeration Documentation#
sl_zigbee_af_plugin_simple_clock_time_sync_status_t#
sl_zigbee_af_plugin_simple_clock_time_sync_status_t
Enumerator | |
---|---|
SL_ZIGBEE_AF_SIMPLE_CLOCK_NEVER_UTC_SYNC | |
SL_ZIGBEE_AF_SIMPLE_CLOCK_STALE_UTC_SYNC | |
SL_ZIGBEE_AF_SIMPLE_CLOCK_UTC_SYNCED |
39
of file app/framework/plugin/simple-clock/simple-clock.h