Follow-up Comment #18, sr #111312 (group freeipmi):

Hi,

Lets try this patch (also in my git branch from earlier if you want to get
from there).

diff --git a/libfreeipmi/util/ipmi-sensor-util.c
b/libfreeipmi/util/ipmi-sensor-util.c
index 5d50239d4..205c416fc 100644
--- a/libfreeipmi/util/ipmi-sensor-util.c
+++ b/libfreeipmi/util/ipmi-sensor-util.c
@@ -285,6 +285,8 @@ ipmi_sensor_decode_value (int8_t r_exponent,
       return (-1);
     }
 
+  fprintf (stderr, "ipmi-sensor-decode: raw value = %X\n", raw_data);
+
   if (analog_data_format == IPMI_SDR_ANALOG_DATA_FORMAT_UNSIGNED)
     dval = (double) raw_data;
   else if (analog_data_format == IPMI_SDR_ANALOG_DATA_FORMAT_1S_COMPLEMENT)
@@ -296,9 +298,13 @@ ipmi_sensor_decode_value (int8_t r_exponent,
   else /* analog_data_format == IPMI_SDR_ANALOG_DATA_FORMAT_2S_COMPLEMENT */
     dval = (double)((char) raw_data);
 
+  fprintf (stderr, "ipmi-sensor-decode: dval initial = %f\n", dval);
   dval *= (double) m;
+  fprintf (stderr, "ipmi-sensor-decode: dval 1 = %f\n", dval);
   dval += (b * pow (10, b_exponent));
+  fprintf (stderr, "ipmi-sensor-decode: dval 2 = %f\n", dval);
   dval *= pow (10, r_exponent);
+  fprintf (stderr, "ipmi-sensor-decode: dval 3 = %f\n", dval);
 
   switch (linearization)
     {
@@ -338,6 +344,7 @@ ipmi_sensor_decode_value (int8_t r_exponent,
       break;
     }
 
+  fprintf (stderr, "ipmi-sensor-decode: dval 4 = %f\n", dval);
   *value = dval;
   return (0);
 }


this is what I see on my end hard coding your values

ipmi-sensor-decode: raw value = FB
ipmi-sensor-decode: dval initial = -5.000000
ipmi-sensor-decode: dval 1 = -315.000000
ipmi-sensor-decode: dval 2 = 3715.000000
ipmi-sensor-decode: dval 3 = 37.150000
ipmi-sensor-decode: dval 4 = 37.150000



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/support/?111312>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to