adafruit / Bluefruit_LE_Connect_Android

Android port of Adafruit's Bluefruit LE Connect app
MIT License
122 stars 100 forks source link

Delete bonding information for Bluetooth device? #7

Closed microbuilder closed 6 years ago

microbuilder commented 9 years ago

We recently added a 'keyboard' demo, where the Bluetooth devices advertise and function as a Bluetooth Low Energy keyboard.

The SW (though still in development) works fine, and we can send characters to iOS and Android and connect the keyboard to the mobile devices through a process called 'bonding', where the two devices pair themselves together for secure data exchange. This happens in the Bluetooth config panel, similar to how you could connect Bluetooth headphones or speakers, etc.

The problem with this process is that it breaks the DFU SW since the bonding establishes an encryption key between the two devices, but when we reset into the bootloader to do a firmware update the bootloader is not aware of this key, and so the update process fails.

The work around is to delete the bonding information (via the Bluetooth config panel) before doing the DFU update, removing the link between the phone and the Bluetooth LE device and causing the connection to no longer be encrypted.

This isn't a great user experience, though. Is it possible to delete the bonding information for the connected Bluetooth Low Energy device purely in SW? That way, we can delete the bond information for the connected device BEFORE doing the DFU update, and then the user can rebond after the firmware update.

The user still has to rebond in this case, but it's less likely to get filed as a bug report since you will more naturally thing you have to rebond after a firmware update than before.

I'm not sure if iOS or Android allow us to delete bond data in SW, though, and they may restrict this behaviour???

antonio-openroad commented 6 years ago

According to the Nordic DFU SDK documentation it is possible to keep the bonding information during DFU updates. Is there any quick way to test it? Is the keyboard SW available? Let's move the conversation to the new respository: https://github.com/adafruit/Bluefruit_LE_Connect_Android_v2