X hits on this document

PDF document

February 10, 2006 - page 147 / 238

665 views

0 shares

0 downloads

0 comments

147 / 238

8.6. USING SENSORS IN OPENIPMI

135

This allows you to find the size and copy the information in one of these structures. For example, to make your own copy, do something like:

m y _ t h = m a l l o c ( i p m i _ t h r e s h o l d s _ s i z e ( ) ) if (!my_th) ;

handle_error() else

ipmi_copy_thresholds(my_th, th);

If you want to create one, allocate it as above and initialize it with void ipmi_thresholds_init(ipmi_thresholds_t *th); This clears all settings. The following functions are then available to set the various threshold values:

ipmi_sensor_t

*sensor,

enum ipmi_thresh_e

threshold,

double

value);

int ipmi threshold set(ipmi thresholds t

_

_

_

_

*th,

int ipmi threshold_get(ipmi_thresholds_t enum ipmi_thresh_e double

_

*th, threshold, *value);

These get and set the values in the data structure. This does not affect the actual sensor until you send the thresholds to the sensor. To send a set of thresholds to a sensor, use the following function:

_ _ ipmi thresholds t

*thresholds,

_ _ _ ipmi sensor done cb done,

void

_ *cb data);

i n t i p m i _ s e n s o r _ s e t _ t h r e s h o l d s ( i p m i _ s e n s o r _ t

*sensor,

To get the current threshold settings of a sensor, use:

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

*sensor, err,

i p m i _ t h r e s h o l d s _ t * t h ,

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

* c b _ d a t a ) ;

void

* c b _ d a t a ) ;

_ _ int ipmi_sensor_threshold event supported(

_ ipmi sensor_t

*sensor,

_ enum ipmi_thresh e

threshold,

_ _ _ _ _ enum ipmi event value dir e value dir,

_ _ _ enum ipmi event dir e

dir,

int

*val);

To find out which thresholds support events, the following can be used to tell if a specific thresholds support a specific event:

Document info
Document views665
Page views665
Page last viewedFri Dec 09 16:02:26 UTC 2016
Pages238
Paragraphs8090
Words85809

Comments