Sensor value calculation formula
Deng Tyler
tyler.sabdon at gmail.com
Thu Mar 7 00:31:48 AEDT 2019
Hi all:
Sensor reading, according to IPMI spec, is calculated as:
y = L[(Mx + B * 10^(bExp)) * 10^(rExp)]
- y: the 'final value' as reported by IPMItool
- x: 8 bits, unsigned, reading data encoded in IPMI response packet
- M: 10 bits, signed integer multiplier, multiplierM in YAML
- B: 10 bits, signed additive offset, offsetB in YAML
- bExp: 4 bits, signed, bExp in YAML
- rExp: 4 bits, signed, rExp in YAML
ipmid calculate raw data by
double value = variant_ns::get<T>(propValue) * std::pow(10,
sensorInfo.scale - sensorInfo.exponentR);
auto rawData = static_cast<uint8_t>((value - sensorInfo.scaledOffset) /
sensorInfo.coefficientM);sue
I am confused about why process raw data with M and rExp? M, offsetB, bExp
and rExp shall just responded to ipmitool and calculate with raw
data. I thought raw data only need calculated by scale if raw data need to
be adjust before respond to ipmitool.
Now I met a problem, I have a raw data is 2100 and I want to display 12.0
in ipmitool sdr command. I don't know how to assign M, rExp and scale value
in yaml.
Could some one tell me how to translate sensor value? tks.
Tyler
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20190306/c08a3c08/attachment.htm>
More information about the openbmc
mailing list