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

Insteon: Validate Cmd1 Data for Peek Responses #56

Closed
krkeegan opened this issue Feb 4, 2013 · 0 comments
Closed

Insteon: Validate Cmd1 Data for Peek Responses #56

krkeegan opened this issue Feb 4, 2013 · 0 comments
Assignees

Comments

@krkeegan
Copy link
Collaborator

krkeegan commented Feb 4, 2013

Cmd1 in peek response messages is periodically corrupted. However, MH will still decode and treat the message as valid. It shouldn't do that.

A logged example can be found here:

http://pastebin.com/w5ZpXe6W

In this case an error occurs in scanning byte 0FF0. Specifically on line 83, the PLM receives the following message: 02500bbb541a794c27a40e. Decoding this message results in:
0250 - Standard Insteon Message
0bbb54 - From Address
1a794c - To Address
27 - Message Flags
a4 - This is a non-existant message type This should read 2B
0e - This should have been A2

@ghost ghost assigned krkeegan Feb 4, 2013
krkeegan added a commit to krkeegan/misterhouse that referenced this issue Feb 6, 2013
Fixes hollie#56

Responses to Peek requests should contain command code 2b as Cmd1, if we receive a message in which Cmd1 is not 2b, then it could either be corrupted or an out of sequence message.  To prevent corrupting MH link hash, ignore the message.  This will cause a resend to occur.

Similarly Set_msb responses should contain command code 28 as Cmd1.  Do the same if Cmd1 is incorrect.

This logic probably would be more appropriate in the _on_peek portion of AllLinkDatabase.pm, however, _on_standard_receive blindly clears the active message without concern for whether the messages are valid.  As such, the logic had to be placed at the lower BaseInsteon.pm level.
@krkeegan krkeegan closed this as completed Feb 6, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant