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#

void

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().

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.

Enumerations#

enum
SL_ZIGBEE_AF_SIMPLE_CLOCK_NEVER_UTC_SYNC = 0
SL_ZIGBEE_AF_SIMPLE_CLOCK_STALE_UTC_SYNC = 1
SL_ZIGBEE_AF_SIMPLE_CLOCK_UTC_SYNCED = 2
}

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.

Parameters
N/AutcTimeSeconds

UTC time in seconds


Definition at line 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().

Parameters
N/A

Returns

  • sl_zigbee_af_plugin_simple_clock_time_sync_status_t Simple time sync status


Definition at line 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.

Parameters
N/AmillisecondsRemainderReturn

Pointer to variable where the remainder milliseconds will be stored

Returns

  • uint32_t Current time in seconds


Definition at line 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

Definition at line 39 of file app/framework/plugin/simple-clock/simple-clock.h