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

Fix DDF handling of negative values and values above 2^52 #5910

Merged
merged 1 commit into from
Mar 27, 2022

Conversation

manup
Copy link
Member

@manup manup commented Mar 27, 2022

For signed integers the C++ union is tricky as the correct member needs to be
extracted. In contrast to unsigned integers num.s16 != num.s64. Since the
ZclAttribute already has the correct negative number in its internal QVariant
we can just use it.

Also expose 56-bit values as string since JS only has 2^52 integers.

The scopes where added to prevent stack corruption (not actually reported but to be safe..).

For signed integers the C++ union is tricky as the correct member needs to be
extracted. In contrast to unsigned integers  num.s16 != num.s64. Since the
ZclAttribute already has the correct negative number in its internal QVariant
we can just use it.

Also expose 56-bit values as string since JS only has 2^52 integers.

The scopes where added to prevent stack corruption  (not actually reported but to be safe..).
@manup manup added this to the v2.15.1 milestone Mar 27, 2022
@manup manup linked an issue Mar 27, 2022 that may be closed by this pull request
@manup manup merged commit ef46d1b into dresden-elektronik:master Mar 27, 2022
@ebaauw
Copy link
Collaborator

ebaauw commented Mar 27, 2022

Does this also fix the power value -1 for the unisys D1 R? See ebaauw/homebridge-deconz#29 (comment).

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.

Temperature=0 In Phoscon with 2.15.0
2 participants