-
March 12th, 2007, 10:34 AM
#1
Callback Data works differently?
I run the following piece of code in Girder4 and the callback "data" returns 1 line at a time, so "string.find(data, "state: ", 0)" returns 1 7. In Girder5 it returns 212 217 each time so it seems that the data in the callback is returning the whole 20 lines or so that the command "status" calls.
Before I update all my code to address this, should it be doing this or is it a bug???
Thanks
Bill
--------------------------------------------------------------
function zone1callback(data, code)
if string.find(data, "state: ", 0) then
zones.state[thisZone1] = string.gsub(data, "state: ", "")
end
end
function zone1keepAlive()
zone1Socket:Write('status\n')
end
zone1Socket = gip.Open('192.168.102.101', 6605)
zone1Socket:Callback(2, '\r\n', 1000, zone1callback)
zone1Status = gir.CreateTimer("", "zone1keepAlive()", "", true)
zone1Status:Arm(1000)
--------------------------------------------------------------
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules