X hits on this document

PDF document

February 10, 2006 - page 141 / 238

561 views

0 shares

0 downloads

0 comments

141 / 238

8.6. USING SENSORS IN OPENIPMI

129

Note that the more general event enables work and override the more specific ones, so if, for instance, a sensor supports per-state event enables, it will also support the entire sensor and global enables. The entire sensor enable being off will override all per-state enables. The global enable will turn off all events from a management controller no matter what other settings are present.

To receive events from a sensor, an event handler must be registered. An event handler may also be dynamically removed. The following functions do this for discrete sensors:

t y p e d e f i n t ( * i p m i _ s e n s o r _ d i s c r e t e _ e v e n t _ c b ) (

i p m i _ s e n s o r _ t

*sensor,

e n u m i p m i _ e v e n t _ d i r _ e d i r ,

offset, severity, prev_severity, *cb_data, *event); int int int void ipmi event t _ i n t _ i p m i _ s e n s o r _ a d d _ d i s c r e t e _ e v e n t _ h a n d l e r ( i p m i _ s e n s o r _ t i p *sensor, m i _ s e n s o r _ d i s c r e t e _ e v e n t _ c b h a n d l e r ,

void

* c b _ d a t a ) ;

i n t i p m i _ s e n s o r _ r e m o v e _ d i s c r e t e _ e v e n t _ h a n d l e r ( i p m i _ s e n s o r _ t i p *sensor, m i _ s e n s o r _ d i s c r e t e _ e v e n t _ c b h a n d l e r ,

void

* c b _ d a t a ) ;

The following functions do this for threshold sensors:

_ _ _ _ typedef int (*ipmi sensor threshold event cb)(

_ ipmi sensor_t

*sensor,

_ enum ipmi_event_dir e

dir,

enum ipmi_thresh_e

threshold,

ipmi

_

event_value_dir

_

e high_low,

ipmi

_

value_present_e

value_present,

enum enum

unsigned int double void i p m i _ e v e n t raw_value, value, *cb_data, *event); _ t i n t i p m i _ s e n s o r _ a d d _ t h r e s h o l d _ e v e n t _ h a n d l e r ( i p m i _ s e n s o r _ t i p *sensor, m i _ s e n s o r _ t h r e s h o l d _ e v e n t _ c b h a n d l e r ,

void

* c b _ d a t a ) ;

i n t i p m i _ s e n s o r _ r e m o v e _ t h r e s h o l d _ e v e n t _ h a n d l e r ( i p m i _ s e n s o r _ t i p *sensor, m i _ s e n s o r _ t h r e s h o l d _ e v e n t _ c b h a n d l e r ,

void

* c b _ d a t a ) ;

This function should generally be registered in the entity callback that reports the sensor being added, so that no events will be missed. This is a standard event handler as defined in section 2.2.5 on page 20.

Document info
Document views561
Page views561
Page last viewedMon Dec 05 02:05:17 UTC 2016
Pages238
Paragraphs8090
Words85809

Comments