mstovenour/misterhouse — pull request #4 by krkeegan (2013-03-04 05:41:59+00:00)
Title: Fully Merged Support for ALDB_Delta in i2 Code

I reorganized the code as much as I could to decrease the number of changes.

Features:
- Checks and stores ALDB_Delta in the is_info_requested function
- ALDB_Delta is checked before any add, delete, or update link function. Prevents the function from occuring if the ALDB_Delta has changed.
- Scan all changed devices - Checks the ALDB_Delta of each device, if the Delta has not changed, the device scan is skipped

In order to condense the changes a few features had to be dropped:
- Scan_One - which scanned a single link address after it was changed. This was a stop-gap against possible latent errors in MH that might incorrectly store link data in the hash. With improvements in the link management, this is probably not needed.
- Bump_Delta - When power is lost to a device, it resets to Delta 00. At 00 MH can't tell if a device has simply lost power, or has been factory reset. So when a Delta 00 is seen, Bump_delta automatically moves the Delta to 01 by writing to an empty address. Previously bump_delta wrote the exact same data that was peeked, to decrease possible errors. Now Bump_delta writes an empty address to an empty address. Due to improvements in link handling, this is probably not needed.

Has been thoroughly tested on i1 and i2, but less thoroughly on i2cs, although there is no reason to believe it would act different. Tested scan, sync, add, delete, and updates. All worked well.

A future improvement is to collect failed sync and delete devices and report them at the conclusion of the process similar to scan_all_links. It is easy to overlook a device that was out-of-sync in a long list.

Of note, i2 code lacks update_local and update_flags support.