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

Merge i2 aldb support #190

Merged
merged 91 commits into from
May 21, 2013
Merged

Merge i2 aldb support #190

merged 91 commits into from
May 21, 2013

Conversation

krkeegan
Copy link
Collaborator

No description provided.

Michael Stovenour added 30 commits December 22, 2012 01:00
Store engine_version in Insteon::BaseObject
…retrieved with Insteon::BaseObject::engine_version(). Added engine version request to the startup scan. Cleaned up _is_info_request() so that it returns true for both matching commands. Added link_cleanup_report=>0x06 to the known insteon message types.
--lib/Insteon/AllLinkDatabase.pm
Corrected 'use' statements to eliminate "subroutine xxx redefined" warnings with perl -w.
Added ALDB_i2 functions to support scan_link_table() and _write_link() (for sync links).  Duplicated code from ALDB_i1 for now.  Will refactor code later to combine logic. (will need i1 devices for test)
--lib/Insteon/BaseInsteon.pm
Corrected 'use' statements to eliminate "subroutine xxx redefined" warnings with perl -w.
Added support for reading, storing, and saving engine version
Removed dupilcate state save of level
Added support for read_write_aldb command
--lib/Insteon/Lighting.pm
Modified Insteon::LampLinc to inherit Insteon::DeviceController to support LampLinc with local control buttons
--lib/Insteon/Message.pm
Corrected 'use' statements to eliminate "subroutine xxx redefined" warnings with perl -w.
Modified extended message code to properly parse the extra data
Added support for checksums on extended data with i2CS devices
--lib/Insteon_PLM.pm
Added "use Insteon;" as it was necessary after correcting use statements in other modules.
Added extra level 3 debug for the logic that saves message fragments
--lib/Insteon.pm
Added some POD documentation for the functions I studied
Added missing link to interface and unlink from interface tie_event for controllers
Added PLM voice command "initiate linking as controller" to support half-automated i2 device linking
Renamed PLM voice command "show link table to log" to "log links" to match the device voice command.  Compatibility WARNING:  If your code uses the old PLM voice command you will need to change your code to the new command.
Updated get_object to return a match on the base device if there are no matching groups
--lib/Insteon/AllLinkDatabase.pm
Corrected rather nasty "adlb" typos to "aldb" as reported by krkeegan
Added additional state logic to fix "sync links"
Fixed flag logic
Added health=good and inuse=1 properties for PLM aldb
--lib/Insteon/BaseInsteon.pm
Added additional state logic to fix "sync links"
--lib/Insteon/Message.pm
Added logic to ensure message always contains a flag byte even if hop_count==0
--lib/Insteon/MessageDecoder.pm
Renamed user_user_reset to plm_user_reset
--lib/Insteon_PLM.pm
Added support for processing plm_user_reset.  There is no code action associated with the message but it doesn't hang the interface either
For initiate_linking_as_controller changed default group to 01 rather than FF to match how the PLM creates the same links when linking manually
…d ack is received from the device before waiting on the read response
The sub add_link expects get_first_empty_address to return 0 if no empty address is found.

This will prevent trying to add an aldb record to the FFFFFFFFFFFFFFF8 address which clearly doesn't exist.  Instead the user will now get a nice error advising them to scan the link table before trying to sync links.
Added a few print statements to keep up with the environment at Marc's house :)
…if there is an undefined entry in the aldb. Modified add_link so that it doesn't create undefined aldb entries.
…age decoder logic for cmd2. Cleaned up some logging information.
…. Added support for update_link when changing ramprate or dim level.
Reverted change to Insteon->get_object because the original change broke object matching for delete_orphan_links.
Rearranged the module order in ALDB_i2 to match order in ALDB_i1 for future refactor to combine ALDB modules where possible.
Conflicts:
	lib/Insteon/BaseInterface.pm
Moved most of the device specific code into Insteon::BaseObject->_process_message
and let the latter determine if the message transaction should be cleared.  This
provides a better separation between interface level logic and message/device
level logic.  I also implemented more consistent cmd1 checking for the ACKs. There
is more cleanup that can be done here later.  Could probably also move some of
the 'cleanup' logic from on_xx_insteon_received as well.

Implemented a transaction timeout for ALDB i2 extended read requests.  This
was a bit different than other messages since the ACK is not the end of the
transaction.  The refactor made this much easier.
Moved CRC warning message to Insteon::BaseObject->_process_message where
the engine_version can be checked for I2CS.
Walks through every Insteon device and logs:
- Hop Count
- Engine Version
- ALDB Type
- ALDB Health
- ALDB Scan Time
krkeegan and others added 26 commits March 3, 2013 17:37
Fully Merged Support for ALDB_Delta in i2 Code
Insteon, in their infinite wisdom, has added yet another message validity check.  This check is used only on specific extended length messages and is used instead of the i2cs checksum.

This new message validity test is a two byte CRC value appended to data 13 and data 14 positions of an extended message.  This two byte CRC differs from the one byte checksum used in other extended commands. This CRC calculation is known to be used by the 2441TH Insteon Thermostat as well as the iMeter INSTEON device. It may be used by other devices in the future.

The two byte CRC is only used in some messages sent to and from these devices, but not all messages.

Also clean up debugging code accidentally left behind.
Add CRC16 Support with calculate_crc16
There is little rhyme or reason as to which packets need to have crc16 versus checksum bytes.  As such, it seems like the proper way to note when a crc16 message should be inserted is by use of a flag.
Fix Callback Parms in Update_Link
Insteon::Message add flag to allow crc16 bytes to be inserted
Fixes to Update Link to Solve Perl Warnings
Handle new device where engine_version is blank
Add failure_reason to Insteon::Message
Add failure callback to get_engine_version message
On message timeout call message failure callback prior to clear_active_message
Names in print log messages and callback return packages were incorrect and leftover from when code was in BaseInsteon.pm
Fixes the corruption identified in mstovenour/misterhouse#11
… Received

$$self{pending_aldb}{address} is not set, should be have used $$self{_mem_msb} . $$self{_mem_lsb}
Insteon_i2: Reject ALDB Read Responses Where Address Is Incorrect
Insteon:: ALDB_Query Fix package names in query_aldb_delta
Most of the removals were to clean up how the various modules included each other with use statements
Only set on_level and ramp_rate for ALDB responder entries
Set application retries == 3 for ALDB controller entries
krkeegan added a commit that referenced this pull request May 21, 2013
@krkeegan krkeegan merged commit 7da1407 into hollie:master May 21, 2013
@hollie hollie mentioned this pull request Jun 15, 2013
@mstovenour mstovenour deleted the merge_i2_aldb_support branch December 1, 2013 15:33
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.

2 participants