forked from thelsing/knx
-
Notifications
You must be signed in to change notification settings - Fork 6
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 Sending Wrong Values on Failed Conversion to DPT #30
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cornelius-koepp
changed the title
Fix Sending Wrong Values on Failed Convertion to DPT
Fix Sending Wrong Values on Failed Conversion to DPT
Nov 6, 2024
mgeramb
reviewed
Nov 9, 2024
…ersion to DPT Remove _valueNoSend(..) as valueNoSend(..) is now the same
please add a short description in the Changelog about this |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
Setting a value which cannot be converted to the given DPT did result in unexpected behaviour.
valueNoSendCompare
/valueCompare
resulted in value 0 (and returned change based on this value)valueNoSend
updated state from unitialized to OK, without updating the valuevalue
wrote to GA without setting the KO valueReproduce
For all cases use a value/type combination which results in
KNX_Encode_Value
returnfalse
.Example: value
500
with typeDPT_Value_1_Ucount
, or any otherNote: DPT1 will not fail; ignoring all other bits.
valueNoSendCompare
/valueCompare
: did always set value to 0 (no special preconditions needed beside conversion fail)valueNoSend
: use before any other change of KO. No change in value expected, but read requests will answered (with undefined value)value
use before any other change of KO. Will result in write telegram (with other value included)Fix
Suppress updating, status-update and sending for invalid values.
To Discuss
The fix does not change the public interface for changing/writing KO values, so there will be no feedback if conversion fails. Current methods return type
void
could be changed tobool
to indicate success, without breaking.