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: Add Link_to_Interface for I2CS Devices #265

Merged
merged 9 commits into from
Oct 12, 2013

Conversation

krkeegan
Copy link
Collaborator

@krkeegan krkeegan commented Oct 4, 2013

This is what we have all wanted for a while. It enables MH to create the initial link even on an I2CS device. To use it you just need to call the normal link_to_interface voice command.

The link_to_interface process is slightly slower now as it calls get_enging_version first.

  • If this results in a NAK it calls a specialized I2CS sequence
  • If anything other than a NAK is received, it performs the normal link to interface routine.

The I2CS routine does:

  • Sets the PLM to linking mode
  • Asks the device to link to the PLM
  • Scans the device to get the address of the resulting link
  • Adds the link from the device->PLM

The routine generally works, but because it requires so many steps it is more prone to failure than other routines, but there does not appear to be any harm in calling it multiple times if you are having issues.

Success_callback is eval'd when the ACK for the message is received.
- Note: There are so many callbacks all over the place within the code, it might be nice to condense as many as possible into this routine.
The routine requires a few steps to complete
Each routine needs to have success and failure callback parameters
The routine first checks to see if the device will respond to a get_engine_version request.
If any ACK is received the routine continues as normal.  In this case even if the device is an I2CS, the device must already have link entries as it responds to the PLM.
If a NAK is received, it is assumes that this device is an i2cs and the link_to_interface_i2cs routine is called.
…ng-Complete

Rather than clear the linking mode command when the device ACKs, wait to clear the message until the PLM reports the linking success.
This allows for per device _process_message subs to exist without needing to reproduce all of the eval code.
If flag not cleared, all messages to that device will stall
@krkeegan
Copy link
Collaborator Author

I made a few recent additions that make this much more stable. Buy waiting for the PLM to confirm that a link was made, we are less likely to get messages bumping into each other.

krkeegan added a commit that referenced this pull request Oct 12, 2013
Insteon:  Add Link_to_Interface for I2CS Devices
@krkeegan krkeegan merged commit ef4be61 into hollie:master Oct 12, 2013
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.

1 participant