Here is my revision, but the results remain the same: double sensorMin = 0.0;
if (!ipmi_is_sensor_scanning_enabled(states)) { // Print "Scanning disabled". } else if (ipmi_sensor_get_normal_min_specified(sensor) && 0 == ipmi_sensor_get_normal_min(sensor, &sensorMin) && 0.0 < sensorMin && 0.0 == value) { // Print "NULL reading". } else { // Here is where I process the value and print it out. } This allows for cases where the sensorMin is legitimately 0, but catches cases where we get a zero reading when there is a non-zero minimum. In my machine, scanning is not disabled when the machine is powered off; ipmi_is_sensor_scanning_enabled(states) returns true. In fact, some of the sensors can still be read when the machine is off (e.g. PS1 AC Current). Usually, when the machine is powered off, the power unit sensor has its discrete state set to "power off". Just recently I've seen these machines have no set state for the power unit when it is off. It's never happened before; they are the same machines I've always tested on. Essentially all I need to do is catch the cases where the machine is powered off. I didn't have to worry about this before because I always had that discrete state to rely on. I am unsure how to figure out that the machine is powered off when I don't have the power unit "power off" state asserted. --Jen -----Original Message----- From: Corey Minyard [mailto:[EMAIL PROTECTED] Sent: Monday, December 17, 2007 10:31 AM To: Vanderputten, Jennifer Cc: openipmi-developer@lists.sourceforge.net Subject: Re: [Openipmi-developer] What exactly does this mean? I'm not exactly sure what this means, where did you get this code? A few notes here: * ipmi_sensor_get_normal_min gets a double value, so you should really be comparing with floating point values. * 0 (or really 0.0) and negative values are valid sensor minimums. * 0 (or 0.0, I guess) is a valid value. When getting a reading, you should check ipmi_set_sensor_scanning_enabled() and friends to make sure the data is valid. I would imagine that scanning is disabled when the machine is off, so the values are not useful. -corey [EMAIL PROTECTED] wrote: > > Given the following performed on a threshold sensor reading: > > if (ipmi_sensor_get_normal_min_specified(sensor)) { > > ipmi_sensor_get_normal_min(sensor, &sensorMin); > > } > > if (0 < sensorMin && 0 == value) { > > // NULL reading? > > } > > What does a "NULL reading" mean? I get this reading when my system is > powered off (the BMC is separately powered), but if this happens on a > machine that is not powered off, what does that mean? Or can this only > happen on a system that is powered off? > > Thanks, > > Jen > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------ - > SF.Net email is sponsored by: > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services > for just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketp lace > ------------------------------------------------------------------------ > > _______________________________________________ > Openipmi-developer mailing list > Openipmi-developer@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/openipmi-developer > ------------------------------------------------------------------------- SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ Openipmi-developer mailing list Openipmi-developer@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openipmi-developer