CHAPTER 8. SENSORS
Figure 8.2 on page 121 shows an example of going high and going low thresholds with hysteresis. Notice that the deassertion events don’t get triggered right at the threshold, but as some point beyond the threshold.
There is only one pair of hysteresis values for a sensor. That pair is used for all thresholds in the sensor. One of the members of the pair is a positive threshold, meaning that is is applied to thresholds that go over a specific value. The value must go that much below the threshold before the threshold goes back in range. The other member is a negative threshold, meaning that it is applied to thresholds that go below a given value. The value must go that much above the threshold before the threshold goes back in range.
Discrete sensors report their readings in a 16-bit bitmask, each bit generally representing a discrete state. For instance, consider the slot/connector sensor. Bit 0 tells if there is a fault. Bit 2 tells if a device is present in the slot. Bit 5 tells if power is off on the slot. Each bit tells a completely independent state and they may each be zero or one independently.
You enable events on the sensor by specifying which bits you want to generate events. Like threshold sensors, these events may or may not be user-controllable. The capabilities of the sensor may be fetched by the user.
Table 8.2: Sensor Types and Codes
IPMI Commands Dealing with Sensors
TBD - write this
Using Sensors in OpenIPMI
As mentioned before, IPMI sensors are very complicated. OpenIPMI attempts to hide as much of this complexity as it can, but it can only do so much.
So starting at the beginning, the first thing you need to know about a sensor is its type. You fetch that with the function:
int ipmi_sensor_get_event_reading_type(ipmi_sensor_t *sensor);
This returns a value from the following table. The names in this table are shortened, all these begin with IPMI EVENT READING TYPE . The values are:
The sensor monitors an analog value. All threshold sensors have this value. These are DMI-based usage states. Valid offsets are:
00h - transition to idle 01h - transition to active 02h - transition to busy