mergBLE usage
Brian Milby
brian at milby7.com
Sun Apr 22 15:54:00 EDT 2018
Ah... I didn't connect the "Doug" aka dr_mumps with your full name. (And
you can probably guess that I'm milbybw).
That's what I was saying, you need to write your own timeout.
local sTimeoutCounter
on openCard
-- do your other stuff
put 20 into sTimeoutCounter
send "timeoutCheck" to me in 100 milliseconds
end openCard
on timeoutCheck
-- using "-1" as the signal that we have found a device
if sTimeoutCounter = -1 then
exit timeoutCheck
end if
subtract 1 from sTimeoutCounter
if sTimeoutCounter = 0 then
answer "Did not find anything in time"
-- call your timeout handler
else
send "timeoutCheck" to me in 100 milliseconds
end if
end timeoutCheck
on mergBLEDidDiscoverPeripheral pPeripheral, pName, pRSSI
-- in the code where you identify that you have found your particular
device, add this
put -1 into sTimeoutCounter
end mergBLEDidDiscoverPeripheral
More information about the use-livecode
mailing list