Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

conversion from hex to float #478

Open
UnderPalms opened this issue Jan 24, 2025 · 0 comments
Open

conversion from hex to float #478

UnderPalms opened this issue Jan 24, 2025 · 0 comments

Comments

@UnderPalms
Copy link

I still try to read some temperatures which in particular give some "invalid position in decode" errors when I simply adress them by their datapoint as per definition in the csv-file. Therefore I take known and working datapoints as reference.
For example for hwc Ntc2Sensor:

  • ebusctl read -c hwc Ntc2Sensor gives "35.06;OK" (so, it's 35.06 degrees Celsius)
  • the corresponding hex-value by calling "ebusctl hex -s 31 0ab509030d0100" provides "03300200" as output.

Still I don't understand how the conversion from hex to a decimal number works. I tried a lot considering IEEE754 half precision by utilizing 2 of the bytes. But never I get the desired decimal value.

Surely, the first byte is the amount of usable bytes, which are for the above mentioned example: 30 02 00

How to calculate the decimal number from the hex output?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant