mergBLE usage

Brian Milby brian at milby7.com
Sun Apr 22 14:07:39 EDT 2018


I’m guessing you have a card that when you open it will initiate a look for
available connections. You have the appropriate handlers in place that work
if one is found. Now you want the card to not wait forever though?

If that is the case, there are a couple threads on the forum that may help:
https://forums.livecode.com/viewtopic.php?f=75&t=30892
https://forums.livecode.com/viewtopic.php?f=66&t=30853

When you initialize the card, you need to start a process that checks for
an active connection. If time runs out before a connection is made then
call the exception routine. If a connection is made, cancel the check
process. Here is an example from the other threads:

https://forums.livecode.com/viewtopic.php?f=9&t=30862#p165981

(Not exact since in that case a device had already been discovered and it
was waiting on a reply message.)
On Sun, Apr 22, 2018 at 10:16 AM Douglas Ruisaard via use-livecode <
use-livecode at lists.runrev.com> wrote:

> Monte... or anyone else brave enough to contribute :-) (no colored emoji,
> sorry) ...
>
>
>
> Is there a way to time out the attempted connection to a BLE device using
> the mergBLE functions.  I can't seem to find a command which doesn't need a
> peripheral UUID  ... like "mergBLEConnectPeripheral pPeripheral" ...  which
> has a corresponding "fail" message: "mergBLEDidFailToConnectPeripheral
> pPeripheral, pError " ... or can I use this command/message combo in some
> way to look for a BLE device and if not present (or if NO BLE device is
> present / active), timeout and fail?  I need my LC code to be able to
> detect whether a BLE device is present and if not "move on" ... right now,
> my modified code, taken from the example mergBLE script, just waits forever
> for a peripheral which may never appear.
>
>
>
> Thanks in advance
>
> Doug
>
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list