Functions
-
System::Error PostEvent (System::Layer & , void * , System::Object & , System::EventType , uintptr_t )Parentheses used to fix clang parsing issue with these declarations
-
System::Error DispatchEvents (System::Layer & , void * ) -
System::Error DispatchEvent (System::Layer & , void * , System::Event ) -
System::Error StartTimer (System::Layer & , void * , uint32_t ) -
uint64_t GetClock_Monotonic ()Platform-specific function for getting monotonic system time in microseconds.
This function is expected to return elapsed time in microseconds since an arbitrary, platform-defined
epoch. Platform implementations are obligated to return a value that is ever-increasing (i.e. never
wraps) between reboots of the system. Additionally, the underlying time source is required to tick
continuously during any system sleep modes that do not entail a restart upon wake.
The epoch for time returned by this function is *not* required to be the same that for any of the
other GetClock... functions, including GetClock_MonotonicMS().
This function is expected to be thread-safe on any platform that employs threading.
-
Error WillInit (Layer & aLayer, void * aContext) -
Error WillShutdown (Layer & aLayer, void * aContext) -
void DidInit (Layer & aLayer, void * aContext, Error aStatus) -
void DidShutdown (Layer & aLayer, void * aContext, Error aStatus) -
uint64_t GetClock_MonotonicMS ()Platform-specific function for getting monotonic system time in milliseconds.
This function is expected to return elapsed time in milliseconds since an arbitrary, platform-defined
epoch. Platform implementations are obligated to return a value that is ever-increasing (i.e. never
wraps) between reboots of the system. Additionally, the underlying time source is required to tick
continuously during any system sleep modes that do not entail a restart upon wake.
The epoch for time returned by this function is *not* required to be the same as that for any of the
other GetClock... functions, including GetClock_Monotonic().
This function is expected to be thread-safe on any platform that employs threading.
-
uint64_t GetClock_MonotonicHiRes ()Platform-specific function for getting high-resolution monotonic system time in microseconds.
This function is expected to return elapsed time in microseconds since an arbitrary, platform-defined
epoch. Values returned by GetClock_MonotonicHiRes() are required to be ever-increasing (i.e. never
wrap). However, the underlying timer is *not* required to tick continuously during system
deep-sleep states.
Platform are encouraged to implement GetClock_MonotonicHiRes() using a high-resolution timer
that is not subject to gradual clock adjustments (slewing). On platforms without such a timer,
GetClock_MonotonicHiRes() can return the same value as GetClock_Monotonic().
The epoch for time returned by this function is not required to be the same that for any of the
other GetClock... functions.
This function is expected to be thread-safe on any platform that employs threading.
-
Error GetClock_RealTime (uint64_t & curTime)Platform-specific function for getting the current real (civil) time in microsecond Unix time
format.
This function is expected to return the local platform's notion of current real time, expressed
as a Unix time value scaled to microseconds. The underlying clock is required to tick at a
rate of least at whole seconds (values of 1,000,000), but may tick faster.
On those platforms that are capable of tracking real time, GetClock_RealTime() must return the
error WEAVE_SYSTEM_ERROR_REAL_TIME_NOT_SYNCED whenever the system is unsynchronized with real time.
Platforms that are incapable of tracking real time should not implement the GetClock_RealTime()
function, thereby forcing link-time failures of features that depend on access to real time.
Alternatively, such platforms may supply an implementation of GetClock_RealTime() that returns
the error WEAVE_SYSTEM_ERROR_NOT_SUPPORTED.
This function is expected to be thread-safe on any platform that employs threading.
Parameters
curTime [out] The current time, expressed as Unix time scaled to microseconds. -
Error GetClock_RealTimeMS (uint64_t & curTimeMS)Platform-specific function for getting the current real (civil) time in millisecond Unix time
format.
This function is expected to return the local platform's notion of current real time, expressed
as a Unix time value scaled to milliseconds.
See the documentation for GetClock_RealTime() for details on the expected behavior.
Parameters
curTime [out] The current time, expressed as Unix time scaled to milliseconds. -
Error SetClock_RealTime (uint64_t newCurTime)Platform-specific function for setting the current real (civil) time.
Weave calls this function to set the local platform's notion of current real time. The new current
time is expressed as a Unix time value scaled to microseconds.
Once set, underlying platform clock is expected to track real time with a granularity of at least whole
seconds.
On platforms that support tracking real time, the SetClock_RealTime() function must return the error
WEAVE_SYSTEM_ERROR_ACCESS_DENIED if the calling application does not have the privilege to set the
current time.
Platforms that are incapable of tracking real time, or do not offer the ability to set real time,
should not implement the SetClock_RealTime() function, thereby forcing link-time failures of features
that depend on setting real time. Alternatively, such platforms may supply an implementation of
SetClock_RealTime() that returns the error WEAVE_SYSTEM_ERROR_NOT_SUPPORTED.
This function is expected to be thread-safe on any platform that employs threading.
Parameters
newCurTime [in] The new current time, expressed as Unix time scaled to microseconds.