Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
typedef enum _EventId_t {
     IARM_BUS_IRMGR_EVENT_IRKEY = 0,
     IARM_BUS_IRMGR_EVENT_MAX
 } 

 
 Naming

...

Convention:

...

IARM_BUS_<Manager>EVENT<Event

...

Name>

...

...

_EVENT_MAX must have the value of (Number Of Events Published + 1). This MAX value is used when registering all events to the IARM –Bus. 
An event may or may not have Event Data. If an event has event data, the data types must be declared so that the listeners of the events can process the data properly. The data structure should a union of event data for all events that the application would send. For example, IR Manager's IR Event Data contains a keyType and KeyCode field.

Code Block
typedef struct _IRMgr_EventData_t {
    union {
       struct _IRKEY_DATA{
           int keyType;
 	   int keyCode;
       } irkey, fpkey;
   } data; 
}IARM_Bus_IRMgr_EventData_t; 

Naming

...

Convention:

...

IARM_Bus_<Manager>_EventData_t

...

Note
The event data structure cannot have pointers. The sizeof() operator applied on the _EventData_t must equal to the actual memory allocated. Internally an equivalent of memcpy() is used to dispatch event data to its target. If a pointer is used in the event data, the pointer, not the content it points to, is sent to the destination.

...