The Generic plugin


The Generic event-source plugin relies on a PPS server object (/pps/services/hmi-notification/control) that clients can use to issue asynchronous events to the HNM. Clients send an event command with the appropriate parameters and values, while the HNM responds via the /pps/services/hmi-notification/Status and /pps/services/hmi-notification/Messaging objects. For details on those objects, see their entries in the PPS Objects Reference.

Callback functions

The Generic plugin uses these callback functions:
The plugin subscribes to the /pps/services/hmi-notification/control PPS object, listening for clients to publish events. The plugin creates this PPS object when the open() function is called.
The counterpart to the open() callback, this callback is responsible for closing its connection to the control object.
This function is responsible for decoding changes made to the control object and for constructing events that will be passed to the HNM policy subsystem.

For more information, see "API Reference" in this guide.

Loading the plugin

To load the Generic plugin, make sure the following lines are in the modules section of the HNM policy configuration file (policy.cfg):
Generic {
			dll = /lib/dll/hmi-notification/

Note that the Generic plugin doesn't have an associated event-priority map. Event names for the plugin are specified at run time only through PPS event messages.

Reporting errors

The Generic plugin will write messages to the system log periodically. The verbosity is configurable, but the level currently can be set only at compile time. To do this, set the SLOG_VERBOSITY preprocessor symbol to a positive number when compiling; the greater this value, the more information will be written to the system log. The default verbosity level is _SLOG_ERROR (i.e., print only critical and error messages).

You can configure the plugin to print log messages to the standard output stream. To do this, define the LOG_TO_STDOUT preprocessor symbol at compile time. You can also have the plugin generate additional debugging information (e.g., source file, function name, line number) by defining the DEBUG flag at compile time.