8.6. USING SENSORS IN OPENIPMI
As mentioned before, threshold sensors monitor analog values. This means that they have a lot of information about how to convert the values from the raw readings (the 0-255 value returned from the sensor) into useful readings, what thresholds are supported, hysteresis settings, and a plethora of other settings. Lots of things
can be set up for threshold sensors.
_ _ enum ipmi value_present e value_present,
_ ipmi_states t
Threshold Sensor Readings in OpenIPMI The reading of a threshold sensor is done with the following:
t y p e d e f v o i d ( * i p m i _ s e n s o r _ r e a d i n g _ c b ) ( i p m i _ s e n s o r _ t
IPMI NO VALUES PRESENT - Neither the raw or the converted values are present. Only the states are valid. This will be the case for thresholds sensors that cannot have their value read.
Assuming there was no error, the value present field will be set to one of the following:
* c b _ d a t a ) ;
i n t i p m i _ s e n s o r _ g e t _ r e a d i n g ( i p m i _ s e n s *sensor, o r _ t i p m i _ r e a d i n g _ d o n e _ c b d o n e ,
IPMI RAW VALUE PRESENT - Only the raw value is present. This will be the case if there was no conversion algorithm available for the sensor.
will return true if the given threshold is out of range and false if not.
IPMI BOTH VALUES PRESENT - Both the raw and converted values are present.
This may not mean that the threshold will generate events (although it will almost certainly mean that, the spec is not clear on this). It is only defined to mean that the threshold is returned in the reading.
For threshold sensors, the function:
The current states of the various thresholds (whether they are out of range or note) is returned in the states parameter. To know if a sensor sets a threshold state setting when the value is read, use the following
i n t i p m i _ s e n s o r _ t h r e s h o l d _ r e a d i n g _ s u p p o r t e d ( i p m i _ s e n s o r _ t
*states, e thresh);
i n t i p m i _ i s _ t h r e s h o l d _ o u t _ o f _ r a n g e ( i p m i _ s t a t e enum ipmi_thresh s _ t