Insteon PLM Ruby Code 351: Difference between revisions
Appearance
No edit summary |
m Added category: GSD |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
{{Versioninfo}} | |||
[[Category: GSD]] | |||
<pre>#### Written by Dan Damron | <pre>#### Written by Dan Damron | ||
#### #351 Process IDLE #### | #### #351 Process IDLE #### | ||
| Line 43: | Line 45: | ||
end | end | ||
end</pre> | end</pre> | ||
[[category: Insteon]] | |||
Latest revision as of 13:52, 7 July 2016
| Version | Status | Date Updated | Updated By |
|---|---|---|---|
| 710 | Unknown | N/A | N/A |
| 810 | Unknown | N/A | N/A |
| 1004 | Unknown | N/A | N/A |
| 1204 | Unknown | N/A | N/A |
| 1404 | Unknown | N/A | N/A |
| Usage Information | |||
#### Written by Dan Damron
#### #351 Process IDLE ####
############################ RECEIVE Error Trap ###########################
if $cmdqueue.length != 0
if $resetNext != 0
log($red + 'receive timeout='+$resetNext.to_s + $grey)
end
if $cmdqueue.to_s == $savedstate
if $resetNext == $timeout
if $attempts == 2 then
#Third attempt.. fail the command.
log('Third attempt, Failing Command!')
$recvbuff = ''
$currentcmd = 0
$attempts = 0
#Here, I should remove the child
removecurrentcommand
else
#Command has stalled. Reset wait flag and resend command.
log('Command Stalled! resetting and retrying')
log('Current Command:' + $currentcmd.to_s)
$recvbuff = ''
$currentcmd = 0
$attempts += 1
#hack to reset the command
if $cmdqueue[0]['Command'] == 'InsStdMsg'
$cmdqueue[0]['Command'] = 'SndIns'
end
end
$wAIT = false
$resetNext = 0
SndIns()
else
$resetNext +=1
end
else
$resetNext = 0
$savedstate = $cmdqueue.to_s
$attempts = 0
end
end