Skip to content
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

Merged
merged 5 commits into from
Jan 27, 2021

Conversation

jedi7
Copy link
Contributor

@jedi7 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

jedi7 added 5 commits January 27, 2021 07:37
* 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];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is double really needed?

Copy link
Contributor Author

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.

Copy link
Collaborator

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.

Copy link
Contributor Author

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

@merbanan merbanan merged commit 2690399 into merbanan:master Jan 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants