-
Notifications
You must be signed in to change notification settings - Fork 25
Clean the action/data bytes interpretation in parser.js #56
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
Conversation
telegram bytes 8+9 were missing bit masking and shifting to make interpretation according to "KNX Grundkursunterlagen" vol 2009, page 22. This led to strange values for DPT1 raw data (two additional bits in the value) and strange action values (should be only 0,1,2, and 10)
|
LGTM |
|
Published to npm registry with 0.4.1. |
|
Hi André, I forgot to change the decoder at we need to take out the -64 in I cannot create a PR right now, possibly first change next weekend, but this might break applications. Best regards |
|
@snowdd1 thanks for the comment. I'll take care about it today. And don't hesitate... It's not your fault. Guess we need a test for the parser. I was this lazy "Oh, cool. Tests passed. Should work" 😃 if(value > 1) {
value = value-64;
}I'm curious about this line. Needs this line may also to be removed? It looks like real workaround, but I'm little bit out of context right now. |
|
I checked it using direct outputs from DPT1 writes. The only values that are passed are 0 and 1 without any further processing. But to comply with the documentation we would need to add a bitmap masking of So Of course, if it isn't a DPT1 but a dimmer step or something similar which also comes in with only 8 bytes the interpretation is wrong, because those can use more than 1 bit (3 bits IRC). |
|
I think I stumbled upon the same issue when i reviewed the decoders. I have not touched the parser but just the decoder.js: |
|
@snowdd1 thank you for the feedback. Published with 0.4.2. |
|
Great, and sorry for the issue at all. But now it should be so clean that any external DPT parser can use the "telegram" event to parse any data coming in, assuming that the DPT is known to the parser. |
telegram bytes 8+9 were missing bit masking and shifting to make interpretation according to "KNX Grundkursunterlagen" vol 2009, page 22.
This led to strange values for DPT1 raw data (two additional bits in the value) and strange action values (should be only 0,1,2, and 10)
Discovered this while working on a backend for CometVisu using knxd + node-eibd