Versions Compared

Key

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

...

Note
Under iarm/template, a template implementation of a generic Manager Component is provided. Developer can make a copy of the templates and modify from it to suit their application needs. The template conforms to the guidelines explained in this section.

 


The directory under IARM should use this structure:

...

_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 akeyType and KeyCode field.

...

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.

Register Event to IARM-Bus

An Event must be Registered with IARM-Bus first before it can be sent out or listened to. The application that registers the event is considered the Owner of the event. During initialization, the owner can register all the events it will send to the bus. 
Now that both the event and event data are declared, the application can register all its events to the IARM-Bus. Note how _EVENT_MAX constant is used here to register all events in a single call.

...