-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend decoded values + HCA #1630
Extend decoded values + HCA #1630
Conversation
jedi7
commented
Jan 27, 2021
- add support for BCD value decoding and 64bit values
- add support for H.C.A
- add support for OnTime and Operation Time
* add support for BCD value decoding and 64bit values * add support for H.C.A * add support for OnTime and Operation Time
@@ -310,7 +330,7 @@ static data_t *append_val(data_t *data, enum UnitType unit_type, uint8_t value_t | |||
fprintf(stderr, "M-Bus: Program error, exp (%d) is out of bounds", exp); | |||
return data; | |||
} | |||
float fvalue = val * pow10_table[exp]; | |||
double fvalue = val * pow10_table[exp]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is double really needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not fully sure. But I increased it because we have here 64bit values. So to keep precision.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not do what one might think. The calculation ist float, the float is then stored as double.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right, I forgot to change also pow10_table