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 emberAfGetCurrentTimeCallback and emberAfSetTimeCallback. When the application knows the current time (e.g., by reading the time attribute from a time server), it should call emberAfSetTime 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 EMBER_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 emberAfPluginSimpleClockSetUtcSyncedTime().

uint32_t
emberAfGetCurrentTimeSecondsWithMsPrecision(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
EMBER_AF_SIMPLE_CLOCK_NEVER_UTC_SYNC = 0
EMBER_AF_SIMPLE_CLOCK_STALE_UTC_SYNC = 1
EMBER_AF_SIMPLE_CLOCK_UTC_SYNCED = 2
}

API Documentation#

emberAfPluginSimpleClockSetUtcSyncedTime#

void emberAfPluginSimpleClockSetUtcSyncedTime (uint32_t utcTimeSeconds)

Set the time and notes it as synchronized with UTC. The Sync status will be set to EMBER_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

emberAfPluginSimpleClockGetTimeSyncStatus#

EmberAfPluginSimpleClockTimeSyncStatus emberAfPluginSimpleClockGetTimeSyncStatus (void )

Retrieve the status of the simple-clock and whether it has been synchronized with UTC via a previous call to emberAfPluginSimpleClockSetUtcSyncedTime().

Parameters
N/A

Returns

  • EmberAfPluginSimpleClockTimeSyncStatus Simple time sync status


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

emberAfGetCurrentTimeSecondsWithMsPrecision#

uint32_t emberAfGetCurrentTimeSecondsWithMsPrecision (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#

EmberAfPluginSimpleClockTimeSyncStatus#

EmberAfPluginSimpleClockTimeSyncStatus
Enumerator
EMBER_AF_SIMPLE_CLOCK_NEVER_UTC_SYNC
EMBER_AF_SIMPLE_CLOCK_STALE_UTC_SYNC
EMBER_AF_SIMPLE_CLOCK_UTC_SYNCED

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