1
votes

Is it possible to scan for peripherals advertising a UUID that is not a known profile while in background? I've got a peripheral advertising these service UUIDs: 1804, 1802, 1803, "00000200-37CB-11E3-8682-0002A5D5C51B

When I scan like this:

centralManager.scanForPeripheralsWithServices([CBUUID(string:"00000200-37CB-11E3-8682-0002A5D5C51B")], options: nil)

I'm not able to find the device when in background, however, when I scan like this:

centralManager.scanForPeripheralsWithServices([CBUUID(string:"1804")], options: nil)

I can find the device when in background.

I also wonder what the use of CBCentralManagerScanOptionSolicitedServiceUUIDsKey is and how specifying this option differs from using the first argument in scanForPeripheralsWithServices.

1

1 Answers

0
votes

In principle, you can indeed scan for an "unknown profile". However, some platforms limit the profiles scanned to only standard specification ID's. What language are you using? The string must also follow the standard format.

Avoid the official base UUID: xxxxxxxx-0000-1000-8000-00805f9b34fb, from which all upper 32-bit are reserved (some already assigned.)

You can use a custom 128-bit UUID. There are online tools to generate them. Convert this to an internal n-bit short uuid to each one of your characteristic.