Skip to content

Commit

Permalink
Merge pull request #215 from krkeegan/insteon_alllink_timeout
Browse files Browse the repository at this point in the history
Insteon: Timeout After Receipt of AllLink Broadcast to Avoid Collision w...
  • Loading branch information
krkeegan committed Jun 15, 2013
2 parents 71ee50b + ad4b4b7 commit 6344823
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/Insteon/BaseInsteon.pm
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,16 @@ sub _process_message
} else {
$self->set($p_state, $self);
$$self{_pending_cleanup} = 1;
#Wait to avoid clobbering incomming subsequent cleanup messages
my @links = $self->find_members('Insteon::BaseDevice');
#Timeout is the number of linked devices multiplied by
#the maximum hop length for a direct message and an ACK
#PLM is the +1
my $timeout = (scalar(@links)+1) * 300;
::print_log("[Insteon::BaseObject] DEBUG3 Delaying any outgoing messages ".
"by $timeout milliseconds to avoid collision with subsequent cleanup ".
"messages from " . $self->get_object_name) if ($main::Debug{insteon} >= 3);
$self->interface->_set_timeout('xmit', $timeout);
}
}
elsif ($msg{type} eq 'cleanup')
Expand Down

0 comments on commit 6344823

Please sign in to comment.