Bluetooth promiscuity - mergBLE confusion

Ben Rubinstein benr_mc at cogapp.com
Mon Feb 3 13:45:46 EST 2020


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?

TIA,

Ben




More information about the use-livecode mailing list