Bluetooth promiscuity - mergBLE confusion

Interested adding compiled externals from LiveCode and third parties to your LiveCode projects? This is the place to talk about them.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
Posts: 17
Joined: Mon Apr 17, 2006 9:22 pm

Bluetooth promiscuity - mergBLE confusion

Post by benr_mc » Tue Feb 25, 2020 12:34 pm

[I posted this previously on the use- list, but without response. So I thought I'd dip my toe in the scary waters of the forum]

If I execute `mergBLEScanForPeripheralsWithServices` with no parameters, I then get a shed-load of `mergBLEDidDiscoverPeripheral` messages, as expected (and as warned by the documentation for the service UUIDs parameter:
> If empty all discovered peripherals are returned regardless of their supported services (not recommended).

One of the many peripherals that `mergBLEDidDiscoverPeripheral` reports has the service I'm expecting. If I specify this service UUID in `mergBLEScanForPeripheralsWithServices`, I get... exactly the same result as before, i.e. all the peripherals in range are discovered, regardless of the fact that only one is advertising the service.

I'm also monitoring the `mergBLEPeripheralDidDiscoverServices` message; but this is never received.

Another indication that I may not fully understand what I'm doing: I notice that of all the peripherals reported via `mergBLEDidDiscoverPeripheral`, only one includes any service info - the one which is actually a phone running another LiveCode stack which has used `mergBLECreateService`. While it is gratifying to find this one, it's surprising to me that none of the large cloud of other BLE devices that the scan is picking up advertise any services.

What am I doing wrong?



Post Reply

Return to “Using Externals”