7.7. discover_resources, saHpiResourceDiscover and get_event

It important to understand how the saHpiResourceDiscover , ABI discover_resources and get_event are related. This will explain how resources are communicated between a plug-in and the openhpi infrastructure library

The user application would call the saHpiResourceDiscover function which in turn calls the ABI function discover_resources of all the plug-ins defined in the config file. All this does is instruct the plug-ins to discover their resources and causes them to be stored in the plug-in's rptcache and eventq. So far, the infrastructure did not get any events from the plug-in and the global RPT is empty.

Once the ABI discover_resources returns, another function in the library is called -- get_events -- which is defined in event.c, processes each handler (plug-in) events by calling the ABI get_event. Depending on the type of event, it will be processed and added to the global RPT table.

Note

We have a set of helper utilities to simplify manipulation of RPT and RDR entries into the rptcache and global RPT table. These are discussed later in this document.