Difference between revisions of "Insteon PLM Ruby Code 350"

From LinuxMCE
Jump to: navigation, search
 
(Updated to support X10)
Line 1: Line 1:
<pre>
+
<pre>#### Written by Dan Damron
#### Written by Dan Damron
+
 
#### #350 Process Incoming Data ####
 
#### #350 Process Incoming Data ####
 
buff = ''
 
buff = ''
 
#$recvbuff = ""
 
#$recvbuff = ""
 
while(true)
 
while(true)
  buff=conn_.Recv(128,50)
+
buff=conn_.Recv(128,50)
  if(buff.length() == 0)
+
if(buff.length() == 0)
    break
+
break
  end
+
end
  $recvbuff = $recvbuff + buff
+
$recvbuff = $recvbuff + buff
 
end
 
end
 
debugin($recvbuff)
 
debugin($recvbuff)
#while $recvbuff[0] != 0x02
 
# log("GARBAGE IN: %X" %$recvbuff[0])
 
# if $recvbuff.length == 1
 
# $recvbuff = ''
 
# else
 
# $recvbuff = $recvbuff[1..-1]
 
# end
 
#end
 
#log('Processing Incoming data...sending to plmparse!')
 
 
$recvbuff = plmparse($recvbuff)
 
$recvbuff = plmparse($recvbuff)
 
</pre>
 
</pre>

Revision as of 01:48, 14 February 2008

#### Written by Dan Damron
#### #350 Process Incoming Data ####
buff = ''
#$recvbuff = ""
while(true)
buff=conn_.Recv(128,50)
if(buff.length() == 0)
break
end
$recvbuff = $recvbuff + buff
end
debugin($recvbuff)
$recvbuff = plmparse($recvbuff)