(→Objective) |
|||
| Line 1: | Line 1: | ||
| − | |||
| − | |||
== CM Plug-in Guide== | == CM Plug-in Guide== | ||
| + | |||
===Objective=== | ===Objective=== | ||
| − | + | CM-Plugin is an event controlling policy in Platform-Support-Package(PSP) to allow and/or restrict the events received from HPI and forward them to Application during run-time. The policy is defined by Application. | |
| + | |||
| + | ===What you can learn=== | ||
| + | |||
| + | How to define a policy to control the events in PSP, so that only interested events are forwarded to Application and unintended events are discarded. | ||
| + | |||
| + | ===Building the CM-Plugin model and controlling Events in run-time=== | ||
| + | |||
| + | The example code containing Application and CM-Policy is available in | ||
| + | '''[https://github.com/OpenClovis/SAFplus-Platform-Support-Package/tree/6.0/src/example/cmplugin PSP/src/example]''' | ||
| + | |||
| + | ====Usage of CM-Plugin==== | ||
| + | |||
| + | The policy to control the events are defined in cmPolicy.c and is available in location: \CmPlugin\src\app\common\plugins\cmPolicy.c in specified example. | ||
| + | |||
| + | {| cellspacing="0" cellpadding = "0" border="0" align = "center" width="680" | ||
| + | ! style="color:black;background-color:#ffccaa;" align="center"| cmPolicy.c | ||
| + | |- | ||
| + | |<code><pre> | ||
| + | |||
| + | ClRcT HpiEventFilter(SaHpiSessionIdT session, SaHpiEventT* event, SaHpiRdrT* rdr, SaHpiRptEntryT* rpt) | ||
| + | { | ||
| + | /* Define the policy to Allow, Block or Change the events here */ | ||
| + | if ( /* For Specific condition of Event Ex: event->Severity==SAHPI_MAJOR */) | ||
| + | { | ||
| + | /* Change the event to required form */ | ||
| + | /* event->Severity=SAHPI_MINOR; */ | ||
| + | } | ||
| + | |||
| + | return CL_OK; | ||
| + | } | ||
| + | </pre></code> | ||
| + | |} | ||
| + | |||
| + | * HpiEventFilter() will be contain the details of specific event to be handled and specific modification for that event. | ||
| + | |||
| + | ===How to Run cmPlugin model=== | ||
| + | |||
| + | Copy the image to required location (/root/asp/). | ||
| + | |||
| + | <ol> | ||
| + | |||
| + | <li>Start the SAFplus Platform on deployed node <code><pre> | ||
| + | # cd /root/asp/ | ||
| + | # ./etc/init.d/asp start</pre></code> | ||
| − | + | <li>Generate event using HPI Event Simulator OR through actual hardware <code><pre> | |
| + | # cd /root/asp/bin | ||
| + | # ./hpithres</pre></code> | ||
| + | The logs are available in var/log/sys.latest and application_name.latest | ||
Revision as of 11:51, 8 October 2013
Contents |
CM Plug-in Guide
Objective
CM-Plugin is an event controlling policy in Platform-Support-Package(PSP) to allow and/or restrict the events received from HPI and forward them to Application during run-time. The policy is defined by Application.
What you can learn
How to define a policy to control the events in PSP, so that only interested events are forwarded to Application and unintended events are discarded.
Building the CM-Plugin model and controlling Events in run-time
The example code containing Application and CM-Policy is available in PSP/src/example
Usage of CM-Plugin
The policy to control the events are defined in cmPolicy.c and is available in location: \CmPlugin\src\app\common\plugins\cmPolicy.c in specified example.
| cmPolicy.c |
|---|
|
- HpiEventFilter() will be contain the details of specific event to be handled and specific modification for that event.
How to Run cmPlugin model
Copy the image to required location (/root/asp/).
- Start the SAFplus Platform on deployed node
# cd /root/asp/ # ./etc/init.d/asp start
- Generate event using HPI Event Simulator OR through actual hardware
The logs are available in var/log/sys.latest and application_name.latest# cd /root/asp/bin # ./hpithres