That’s pretty much where we’re heading. The firmware guys have implemented a notifiable characteristic that does not require authentication and indicates whether the bonded pairing is valid or not (from the device end, at least). It remains to be seen if we need to make it more fine-grained.
For now, on the phone side we try to send a diagnostic command to the device via an auth-required characteristic. If it returns a result within N seconds we deduce the pairing is valid but if it times out the only recourse we have is to tell the user to do the ‘Forget Device’ thing (yuck!) and possibly reset the device.
Incidentally, if anyone wants to file a bug report you may want to dupe this one I filed a couple days ago:
#22786727: Allow apps to cleanly 'unpair' BT/BLE devices
I proposed that ther be an API on CoreBluetooth to let the same app that did the pairing initiate an unpairing. If we had that a lot of this could be avoided.
Best, Ramin
On September 23, 2015 at 6:08:27 AM, Martijn The (email@hidden) wrote:
FWIW, how we're dealing with these shortcomings:
1. We're using a notifiable characteristic which value tells
the app A) whether the link is encrypted (so iOS/master must have
valid LTK) and B) whether the device itself has a bonding for the
other device. This way the app can know when iOS has a bonding (it
was able to encrypt the link, which will always happen
automatically by iOS/master at the start of the connection) and
also whether our device has a bonding. When there's a "half
pairing" situation, we unfortunately have to instruct the user to
go to iOS Settings / Bluetooth and "Forget" from there, since there
is no (public) API to remove pairings...
2. We're using a GATT operation to let our app tell our device
(slave/peripheral) it's time to pair -- our device will then send
the "Slave Security Request". This only seems to work if the app is
foregrounded *and* connected to the app (through CoreBluetooth). We
didn't like the implicit pairing, because we want fine control when
the pairing happens so the app can decide when it is appropriate
from a UX point of view to bring up the pairing.
Hope it helps.
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
|