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#
This function sets the time and notes it as synchronized with UTC. The Sync status will be set to EMBER_AF_SIMPLE_CLOCK_UTC_SYNCED.
This function retrieves the status of the simple-clock and whether it has been synchronized with UTC via a previous call to emberAfPluginSimpleClockSetUtcSyncedTime().
This retrieves the current time in seconds, and any millisecond remainder is returned in the passed pointer to the milliseconds value.
Enumerations#
API Documentation#
emberAfPluginSimpleClockSetUtcSyncedTime#
void emberAfPluginSimpleClockSetUtcSyncedTime (uint32_t utcTimeSeconds)
This function sets the time and notes it as synchronized with UTC. The Sync status will be set to EMBER_AF_SIMPLE_CLOCK_UTC_SYNCED.
N/A | utcTimeSeconds | UTC time in seconds |
54
of file app/framework/plugin/simple-clock/simple-clock.h
emberAfPluginSimpleClockGetTimeSyncStatus#
EmberAfPluginSimpleClockTimeSyncStatus emberAfPluginSimpleClockGetTimeSyncStatus (void )
This function retrieves the status of the simple-clock and whether it has been synchronized with UTC via a previous call to emberAfPluginSimpleClockSetUtcSyncedTime().
N/A |
Returns
EmberAfPluginSimpleClockTimeSyncStatus Simple time sync status
62
of file app/framework/plugin/simple-clock/simple-clock.h
emberAfGetCurrentTimeSecondsWithMsPrecision#
uint32_t emberAfGetCurrentTimeSecondsWithMsPrecision (uint16_t * millisecondsRemainderReturn)
This retrieves 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