dougr at telus.net
Tue Apr 24 02:09:46 CEST 2018
Actually... I didn't make that association... so thanks for your help in my previous exploits in mergBLE ... *AND*, of course (as you probably guessed), your offering this time was spot on!.. I'm still getting a handle on how LC handles things like background processing. I'm used to having explicit commands to send code off to run in the background. So the "timer" code runs in the "background" while the BLE commands and functions search for a connection. Cool! I'll get my head wrapped around this eventually...
As to "dr_mumps", those are my initials "dr" and the MUMPS environment (used extensively in the VA hospitals lab systems) is my true expertise
Cheers and thanks again!
> 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
> 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