nRF Connect SDK API 0.1.0
|
Module state event. More...
#include <module_state_event.h>
Data Fields | |
struct app_event_header | header |
const void * | module_id |
enum module_state | state |
Module state event.
The module state event is submitted by a module to inform that state of the module changed. The module_set_state can be used to submit the module state event for a module. The check_state can be used in event_handler to check if the event carries information that selected module reported selected state. See module_state for details about available module states.
Name of the module must be defined as MODULE before including the module_state_event.h header. For example, "#define MODULE buttons" defines name of the module as buttons. The module name is used to identify a module.
Every application module must register for module state event and submit this event when state of the module changes. An application module can initialize itself when all the required application modules are initialized (report MODULE_STATE_READY). This ensures proper initialization order of the application modules.