I have an iOS application that is acting as a BLE peripheral. It is advertising at all times. I have a Raspberry Pi that is acting as a BLE central. It is scanning at all times. If the iOS app goes into the background and is suspended, and if the iOS app has the UIBackgroundModes key set to bluetooth-peripheral, will the app be woken up by a connection request from the central? Assume that the central and the peripheral have never connected before. Thank you!
0
votes
1 Answers
0
votes
You can advertise a peripheral in the background, but there are some limitations, which are described in the Core Bluetooth Programming Guide
- The
CBAdvertisementDataLocalNameKey
advertisement key is ignored, and the local name of peripheral is not advertised.- All service UUIDs contained in the value of the CBAdvertisementDataServiceUUIDsKey advertisement key are placed in a special “overflow” area; they can be discovered only by an iOS device that is explicitly scanning for them.
- If all apps that are advertising are in the background, the frequency at which your peripheral device sends advertising packets may decrease.
The second point, in particular, may make it difficult for your RPi to discover the peripheral; I am not sure if the standard discovery process will work.