AllLinkDatabase.pm


Insteon::AllLinkDatabase

SYNOPSIS

Generic class implementation of an insteon device's all link database.

DESCRIPTION

Generally this object should be interacted with through the insteon objects and not by directly calling any of the following methods.

INHERITS

None

METHODS

new()

Instantiate a new object.

aldb_version([i1|i2])

Used to track the ALDB version type.

If provided, saves version to memory.

Returns the saved version type.

health([out-of-sync|unknown|empty|good])

Used to track the health of MisterHouse's copy of a device's ALDB.

If provided, saves status to memory.

Returns the saved health status.

get_linkkey($deviceid, $group, $is_controller, $data3)

Used to track the health of MisterHouse's copy of a device's ALDB.

If provided, saves status to memory.

Returns the saved health status.

scandatetime([seconds])

Used to track the time, in unix time seconds, of the last ALDB scan.

If provided, saves the time to memory.

Returns the time of the last ALDB scan.

aldb_delta([hex])

Used to track the ALDB Delta. The ALDB Delta starts at 00 and iterates +1 for each change to a device's ALDB. The ALDB Delta will be reset to 00 whenever power is lost to the device or if the device is factory reset.

If provided, saves the hex value to memory. (This should likely only be done by query_aldb_delta())

Returns the current ALDB Delta.

query_aldb_delta([check|set])

Interacts with the device's ALDB Delta.

If called with "check", MisterHouse will query the device to obtain the current ALDB Delta. If the ALDB Delta matches the version stored in aldb_delta MisterHouse will eval the code stored in $self-{_aldb_unchanged_callback}>. If the ALDB Delta does not match, MisterHouse will eval the code stored in $self-{_aldb_changed_callback}>.

If called with "set" will cause MisterHouse to query the device for its ALDB Delta and will store it with aldb_delta.

restore_string()

This is called by mh on exit to save the cached ALDB of a device to persistant data.

restore_aldb()

Used to reload MisterHouse's cached version of a device's ALDB on restart.

scan_link_table()

Scans a device's link table and caches a copy.

delete_link([link details])

Deletes a specific link from a device. Generally called by delete_orphan_links().

delete_orphan_links()

Reviews the cached version of the link database for the device and removes links from THIS device which are not present in the mht file, link to non-existant devices, or which are only half-links.

Since this routine only processes this device, it is best to run the voice command 'delete all orphan links' from the interface so that all devices are scanned and processed.

add_duplicate_link_address([address])

Adds address to the duplicate link hash. Called as part of scan_link_table().

delete_duplicate_link_address([address])

Removes address from the duplicate link hash. Called as part of delete_orphan_links().

add_empty_address([address])

Adds address to the empty link hash. Called as part of delete_orphan_links() or scan_link_table().

get_first_empty_address()

Returns the highest empty link address, or if no empty addresses exist, returns the highest unused address. Called as part of delete_orphan_links() or scan_link_table()..

add_link(link_params)

Adds the link to the device's ALDB. Generally called from the "sync links" or "link to interface" voice commands.

update_link(link_params)

Updates the on_level and/or ramp_rate associated with a link to match the defined value in MisterHouse. Generally called from the "sync links" voice command.

log_alllink_table()

Prints a human readable form of MisterHouse's cached version of a device's ALDB to the print log. Called as part of the "scan links" voice command or in response to the "log links" voice command.

has_link(link_details)

Checks and returns true if a link with the passed details exists on the device or false if it does not. Generally called as part of delete_orphan_links().

INI PARAMETERS

None

AUTHOR

Gregg Liming / gregg@limings.net, Kevin Robert Keegan, Michael Stovenour

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.


Insteon::ALDB_i1

SYNOPSIS

Unique class for storing a cahced copy of a verion i1 device's ALDB.

DESCRIPTION

Generally this object should be interacted with through the insteon objects and not by directly calling any of the following methods.

INHERITS

Insteon::AllLinkDatabase

METHODS

new()

Instantiate a new object.

update_local_properties()

Used to update the local on level and ramp rate of a device. Called by Insteon::BaseDevice::update_local_properties().

update_flags()

Used to update the flags of a device. Called by Insteon::KeyPadLinc::update_flags().

update_intradevice_links()

Used to update the IntraDevice Links on a device. Currently these only exist on KeypadLinc devices. This routine is called by Insteon::Lighting::sync_intradevice_links().

get_link_record()

Gets and returns the details of a link. Called by Insteon::BaseController::update_members().

NOTE - This routine may be obsolete, its parent routine is not called by any code.

INI PARAMETERS

None

AUTHOR

Gregg Liming / gregg@limings.net, Kevin Robert Keegan, Michael Stovenour

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.


Insteon::ALDB_i2

SYNOPSIS

Unique class for storing a cahced copy of a verion i2 device's ALDB.

DESCRIPTION

Generally this object should be interacted with through the insteon objects and not by directly calling any of the following methods.

INHERITS

Insteon::AllLinkDatabase

METHODS

new()

Instantiate a new object.

on_read_write_aldb()

Called as part of any process to read or write to a device's ALDB.

send_read_aldb()

Called as part of "scan link table" voice command.

INI PARAMETERS

None

AUTHOR

Michael Stovenour

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.


Insteon::ALDB_PLM

SYNOPSIS

Unique class for storing a cahced copy of a the PLM's link database.

DESCRIPTION

Generally this object should be interacted with through the insteon objects and not by directly calling any of the following methods.

INHERITS

Insteon::AllLinkDatabase

METHODS

new()

Instantiate a new object.

restore_string()

This is called by mh on exit to save the cached ALDB of a device to persistant data.

restore_linktable()

Used to reload MisterHouse's cached version of a device's ALDB on restart.

log_alllink_table()

Prints a human readable form of MisterHouse's cached version of a device's ALDB to the print log. Called as part of the "scan links" voice command or in response to the "log links" voice command.

parse_alllink()

Parses the alllink message sent from the PLM.

get_first_alllink()

Sends the request for the first alllink entry on the PLM.

get_next_alllink()

Sends the request for the next alllink entry on the PLM.

delete_orphan_links()

Reviews the cached version of all of the ALDBs and based on this review removes links from this device which are not present in the mht file, not defined in the code, or links which are only half-links..

delete_link([link details])

Deletes a specific link from a device. Generally called by delete_orphan_links().

add_link(link_params)

Adds the link to the device's ALDB. Generally called from the "sync links" or "link to interface" voice commands.

add_link_to_hash()

This is used by the Insteon::BaseInterface::link_to_interface_i2cs routine. This routine manually adds a record to MH's cache of the PLM ALDB. Normally you only want to add records during a scan of the ALDB, so use this routine with caution.

has_link(link_details)

Checks and returns true if a link with the passed details exists on the device or false if it does not. Generally called as part of delete_orphan_links().

INI PARAMETERS

None

AUTHOR

Gregg Liming / gregg@limings.net, Kevin Robert Keegan, Michael Stovenour

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

 AllLinkDatabase.pm