Hello
I work on iOS application with acts as Bluetooth peripheral. I need to implement a searching for my iOS peripheral from non iOS centrals. I’m faced with a problem while my iOS application advertising in background mode. When it is advertising in foreground, my central can read primary service UUID from advertising data, but when it is advertising in background, I can’t see the name or the UUID of peripheral – there is only Apple manufacturer data in advertising packet.
The essence of the problem lies in the fact that my non iOS central can’t determinate – is it advertising my peripheral in background or any other peripheral in background. I have to connect every iOS device with advertising in background, enumerate its services to look for my service UUID.
The documentation says that during background advertising all service UUIDs go to special “overflow” area and only iOS devices can read it specifying service in CBCentralManager’s scanForPeripherialWithServices method. It looks like Apple have an ability to check background advertising packet data for service UUID.
After searching on StackOverflow I found some interesting information about service hashed UUID. Background mode advertising packet always contains Apple manufacturer data (14 FF 4c 00 01) and undocumented 128 bit value, where one of these 128 bits equals 1. I tried to change my service UUID several times and found out than this 128 bit value after Apple manufacturer data changes too.
- I’d like to use this value to filter peripherals around and reduce connections to wrong (not mine) peripherals. Can you give any information how this value depends on service UUID? Is there any hash function that is used on specified service UUID in scanForPeripherialWithServices method?
- If the information about this mechanism is confidential, please tell, will the background advertising packet always be the same for the immutable service UUID which will never change?
- Is there any other way to send my custom information while advertising in background mode? Maybe I can add my data into BLE SCAN RESPONSE packet?
Best Regards,
Dezmond