nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches

◆ APP_EVENT_TYPE_DEFINE

#define APP_EVENT_TYPE_DEFINE (   ename,
  log_fn,
  ev_info_struct,
  app_event_type_flags 
)     _APP_EVENT_TYPE_DEFINE(ename, log_fn, ev_info_struct, app_event_type_flags)

#include <include/app_event_manager.h>

Define an event type.

This macro defines an event type. In addition, it defines functions specific to the event type and the event type structure.

For every defined event, the following functions are created, where event_type is replaced with the given event type name ename (for example, button_event):

  • new_event_type - Allocates an event of a given type.
  • is_event_type - Checks if the application event header that is provided as argument represents the given event type.
  • cast_event_type - Casts the application event header that is provided as argument to an event of the given type.
Parameters
enameName of the event.
log_fnFunction to stringify an event of this type.
ev_info_structData structure describing the event type.
app_event_type_flagsEvent type flags. You should use APP_EVENT_FLAGS_CREATE to define them.