Question

I'm working on an iOS app that uses Core Bluetooth to communicate with a BLE device. Does anyone know if it's possible to establish a bounded connection when connecting to the peripheral? In other words, currently the OS initiates a paring request only if the app requests (reads/writes) an encrypted characteristic and I was wondering if there were ways to have the OS initiating the paring request even before - for example when it sees a connection request (basically upon invoking connectPeripheral:options). Is it possible?

Was it helpful?

Solution

No that's not currently possible. The OS is setup to display bonding requests only after a connection has been established between devices, and access has been requested to encrypted characteristics. If the user presses cancel on the bonding request, the connection will be torn down anyways. But since you can only access characteristics after a connection has been established, that's also the only way to bond currently.

It makes sense that it's set up this way though. Without connecting and directly communicating with device that you want to bond with, your other device would have to be scanning for your advertisement data, and then connecting to you (and bonding that way anyways). Wayyy more overhead doing something like that.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top