Versions Compared

Key

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

...

  • Follow the naming conventions recommended.
  • Register to IARM-Bus with its well-known name during initialization.

...


Code Block
IARM_Result_t IARM_Bus_Init(const char name);

...


IARM_Result_t IARM_Bus_Connect(void);
  • Declare its event enumerations and event data types in public header file.
  • Register all its events during initialization using _EVENT_MAX:


Code Block

...

IARM_Result_t IARM_Bus_RegisterEvent(IARM_EventId_t maxEventId);
  • Send/Broadcast Events:

...


Code Block
IARM_Result_t IARM_Bus_BroadcastEvent(const char *ownerName, IARM_EventId_t eventId, void *data, size_t len);

...


 If an application wants to receive and handle events , it needs to :

  • Register to IARM-Bus with its well-known name during initialization.
Code Block

...

IARM_Result_t IARM_Bus_Init(const char *name);

...


        IARM_Result_t IARM_Bus_Connect(void);
  • Register event handler :

...

Code Block
 IARM_Result_t IARM_Bus_RegisterEventHandler(const char *ownerName, IARM_EventId_t eventId, IARM_EventHandler_t handler);
  • Implement the handler.

How to Create and Invoke RPC Methods

...

Since all the RPC methods published by the application are tied to its well-known name, the application must make its well-known name available to other applications that wish to use its service. The well-known name can be thought of as the Namespace within which the application's events and RPC methods live. This name must be declared in the application's public header file. In our example, this file is irMgr.h

Code Block
 #define IARM_BUS_IRMGR_NAME "IRMgr"

...



Naming Convention: IARM_BUS_<Manager>_NAME "Manager"

 When the application initialize with IARM-Bus, it provides its well-known name:

Code Block
 IARM_Bus_Init(IARM_BUS_IRMGR_NAME);

...


IARM_Bus_Connect();

...

 Applications should use macro of the well-known name (IARM_BUS_IRMGR_NAME in this example) when invoking the RPC method.

...