nl::Weave::System::Platform::Layer

Summary

Functions

DidInit(Layer & aLayer, void *aContext, Error aStatus)
NL_DLL_EXPORT void
This is a platform-specific Weave System Layer post-initialization hook.
DidShutdown(Layer & aLayer, void *aContext, Error aStatus)
NL_DLL_EXPORT void
This is a platform-specific Weave System Layer pre-shutdown hook.
DispatchEvent(Layer & aLayer, void *aContext, Event aEvent)
NL_DLL_EXPORT Error
This is a platform-specific event / message dispatch hook.
DispatchEvents(Layer & aLayer, void *aContext)
NL_DLL_EXPORT Error
This is a platform-specific event / message dispatch hook.
PostEvent(Layer & aLayer, void *aContext, Object & aTarget, EventType aType, uintptr_t aArgument)
NL_DLL_EXPORT Error
This is a platform-specific event / message post hook.
StartTimer(Layer & aLayer, void *aContext, uint32_t aMilliseconds)
NL_DLL_EXPORT Error
This is a platform-specific event / message dispatch hook.
WillInit(Layer & aLayer, void *aContext)
NL_DLL_EXPORT Error
This is a platform-specific Weave System Layer pre-initialization hook.
WillShutdown(Layer & aLayer, void *aContext)
NL_DLL_EXPORT Error
This is a platform-specific Weave System Layer pre-shutdown hook.

Functions

DidInit

NL_DLL_EXPORT void DidInit(
  Layer & aLayer,
  void *aContext,
  Error aStatus
)

This is a platform-specific Weave System Layer post-initialization hook.

This may be overridden by assserting the preprocessor definition, WEAVE_SYSTEM_CONFIG_PLATFORM_PROVIDES_XTOR_FUNCTIONS.

Details
Parameters
[in,out] aLayer
A reference to the Weave System Layer instance being initialized.
[in,out] aContext
Platform-specific context data passed to the layer initialization method, ::Init.
[in] anError
The overall status being returned via the Weave System Layer ::Init method.

DidShutdown

NL_DLL_EXPORT void DidShutdown(
  Layer & aLayer,
  void *aContext,
  Error aStatus
)

This is a platform-specific Weave System Layer pre-shutdown hook.

This may be overridden by assserting the preprocessor definition, WEAVE_SYSTEM_CONFIG_PLATFORM_PROVIDES_XTOR_FUNCTIONS.

Details
Parameters
[in,out] aLayer
A reference to the Weave System Layer instance being shutdown.
[in,out] aContext
Platform-specific context data passed to the layer initialization method, ::Shutdown.
[in] anError
The overall status being returned via the Weave System Layer ::Shutdown method.
Returns
WEAVE_SYSTEM_NO_ERROR on success; otherwise, a specific error indicating the reason for shutdown failure. Returning non-successful status will abort shutdown.

DispatchEvent

NL_DLL_EXPORT Error DispatchEvent(
  Layer & aLayer,
  void *aContext,
  Event aEvent
)

This is a platform-specific event / message dispatch hook.

This may be overridden by assserting the preprocessor definition, WEAVE_SYSTEM_CONFIG_PLATFORM_PROVIDES_EVENT_FUNCTIONS.

This dispatches the specified event for handling, unmarshalling the type and arguments from the event for hand off to Weave System Layer::HandleEvent for the actual dispatch.

Details
Parameters
[in,out] aLayer
A reference to the layer instance for which events / messages are being dispatched.
[in,out] aContext
Platform-specific context data passed to the layer initialization method, ::Init.
[in] anEvent
The platform-specific event object to dispatch for handling.
Return Values
#WEAVE_SYSTEM_ERROR_BAD_ARGS
If #aLayer or the event target is NULL.
#WEAVE_SYSTEM_ERROR_UNEXPECTED_EVENT
If the event type is unrecognized.
#WEAVE_SYSTEM_ERROR_UNEXPECTED_STATE
If the state of the Weave System Layer object is unexpected.
WEAVE_SYSTEM_NO_ERROR
On success.

DispatchEvents

NL_DLL_EXPORT Error DispatchEvents(
  Layer & aLayer,
  void *aContext
)

This is a platform-specific event / message dispatch hook.

This may be overridden by assserting the preprocessor definition, WEAVE_SYSTEM_CONFIG_PLATFORM_PROVIDES_EVENT_FUNCTIONS.

This effects an event loop, waiting on a queue that services this instance, pulling events off of that queue, and then dispatching them for handling.

Details
Parameters
[in,out] aLayer
A reference to the layer instance for which events / messages are being dispatched.
[in,out] aContext
Platform-specific context data passed to the layer initialization method, ::Init.
Return Values
#WEAVE_SYSTEM_ERROR_BAD_ARGS
If #aLayer or #aContext is NULL.
#WEAVE_SYSTEM_ERROR_UNEXPECTED_STATE
If the state of the Weave System Layer object is unexpected.
#WEAVE_SYSTEM_ERROR_UNEXPECTED_EVENT
If an event type is unrecognized.
WEAVE_SYSTEM_NO_ERROR
On success.

PostEvent

NL_DLL_EXPORT Error PostEvent(
  Layer & aLayer,
  void *aContext,
  Object & aTarget,
  EventType aType,
  uintptr_t aArgument
)

This is a platform-specific event / message post hook.

This may be overridden by assserting the preprocessor definition, WEAVE_SYSTEM_CONFIG_PLATFORM_PROVIDES_EVENT_FUNCTIONS.

This posts an event / message of the specified type with the provided argument to this instance's platform-specific event / message queue.

Details
Parameters
[in,out] aLayer
A pointer to the layer instance to which the event / message is being posted.
[in,out] aContext
Platform-specific context data passed to the layer initialization method, ::Init.
[in,out] aTarget
A pointer to the Weave System Layer object making the post request.
[in] aType
The type of event to post.
[in,out] anArg
The argument associated with the event to post.
Returns
WEAVE_SYSTEM_NO_ERROR on success; otherwise, a specific error indicating the reason for initialization failure.

StartTimer

NL_DLL_EXPORT Error StartTimer(
  Layer & aLayer,
  void *aContext,
  uint32_t aMilliseconds
)

This is a platform-specific event / message dispatch hook.

This may be overridden by assserting the preprocessor definition, WEAVE_SYSTEM_CONFIG_PLATFORM_PROVIDES_EVENT_FUNCTIONS.

Details
Parameters
[in,out] aLayer
A reference to the layer instance for which events / messages are being dispatched.
[in,out] aContext
Platform-specific context data passed to the layer initialization method, ::Init.
[in] aMilliseconds
The number of milliseconds to set for the timer.
Return Values
WEAVE_SYSTEM_NO_ERROR
Always succeeds unless overridden.

WillInit

NL_DLL_EXPORT Error WillInit(
  Layer & aLayer,
  void *aContext
)

This is a platform-specific Weave System Layer pre-initialization hook.

This may be overridden by assserting the preprocessor definition, WEAVE_SYSTEM_CONFIG_PLATFORM_PROVIDES_XTOR_FUNCTIONS.

Details
Parameters
[in,out] aLayer
A reference to the Weave System Layer instance being initialized.
[in,out] aContext
Platform-specific context data passed to the layer initialization method, ::Init.
Returns
WEAVE_SYSTEM_NO_ERROR on success; otherwise, a specific error indicating the reason for initialization failure. Returning non-successful status will abort initialization.

WillShutdown

NL_DLL_EXPORT Error WillShutdown(
  Layer & aLayer,
  void *aContext
)

This is a platform-specific Weave System Layer pre-shutdown hook.

This may be overridden by assserting the preprocessor definition, WEAVE_SYSTEM_CONFIG_PLATFORM_PROVIDES_XTOR_FUNCTIONS.

Details
Parameters
[in,out] aLayer
A pointer to the Weave System Layer instance being shutdown.
[in,out] aContext
Platform-specific context data passed to the layer initialization method, ::Shutdown.
Returns
WEAVE_SYSTEM_NO_ERROR on success; otherwise, a specific error indicating the reason for shutdown failure. Returning non-successful status will abort shutdown.