<div dir="ltr">Hi Emily, thank for your kindly reply. This is not typo. I want to dispaly 12.0V in ipmitool and my raw data in Dbus is 2100.<div>I know value x length is 1 byte. I concern that why raw data calculate with M, rExp before response to ipmitool.</div><div><br></div><div>Tyler</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Emily Shaffer <<a href="mailto:emilyshaffer@google.com">emilyshaffer@google.com</a>> 於 2019年3月7日 週四 上午6:47寫道:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Tyler,Is this a typo? Do you mean you want to display 21.0 in<br>
ipmitool? I don't know why there is scaling besides power of 10 on<br>
your raw value. That is odd.Assuming it was a typo, what you want to<br>
do is set the scale in the sensor info in order to perform /100<br>
operation. Or you could set the unit, though that might be difficult<br>
with a /100 (rather than increment of 1000).The scaling with m, rExp,<br>
etc is because the IPMI protocol has such a narrow field for sensor<br>
data (1 byte, as you saw; this is value x).So my recommendation to you<br>
is to use the scale to do your 2100->21.0 rounding when displaying<br>
output from ipmitool; and then to use your estimated maximum and<br>
minimum y to try and figure out what kind of coefficients you want to<br>
use.  This doesn't need to be perfect; you will lose some precision if<br>
you choose exponents which give you a much wider range than you need,<br>
but otherwise the operation should be invisible at the other end.If<br>
you really did mean you want 2100 -> 12.0 then that's a different<br>
question, which may require some more massaging on one end or another,<br>
so let us know.<br>
<br>
Emily<br>
<br>
On Wed, Mar 6, 2019 at 5:33 AM Deng Tyler <<a href="mailto:tyler.sabdon@gmail.com" target="_blank">tyler.sabdon@gmail.com</a>> wrote:<br>
><br>
> Hi all:<br>
>     Sensor reading, according to IPMI spec, is calculated as:<br>
><br>
> y = L[(Mx + B * 10^(bExp)) * 10^(rExp)]<br>
><br>
> y: the 'final value' as reported by IPMItool<br>
> x: 8 bits, unsigned, reading data encoded in IPMI response packet<br>
> M: 10 bits, signed integer multiplier, multiplierM in YAML<br>
> B: 10 bits, signed additive offset, offsetB in YAML<br>
> bExp: 4 bits, signed, bExp in YAML<br>
> rExp: 4 bits, signed, rExp in YAML<br>
><br>
>  ipmid calculate raw data by<br>
> double value = variant_ns::get<T>(propValue) * std::pow(10, sensorInfo.scale - sensorInfo.exponentR);<br>
> auto rawData = static_cast<uint8_t>((value - sensorInfo.scaledOffset) / sensorInfo.coefficientM);sue<br>
><br>
> 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<br>
> data. I thought raw data only need calculated by scale if raw data need to be adjust before respond to ipmitool.<br>
> 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.<br>
> Could some one tell me how to translate sensor value? tks.<br>
><br>
> Tyler<br>
><br>
><br>
<br>
<br>
--<br>
Emily Shaffer<br>
</blockquote></div>