- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have two devices that I'm setting up to be bonded to each other upon user-input. It is working well to bond the two devices, but if I try to clear bond information from one of the devices, the other device still retains the bond information and attempts to use it upon reconnection to the other device.
Is there a way to catch when the device I'm connecting to is no longer bonded to the central, but the central still has the bonding information stored for the peripheral device? Or, at least to "update" the bonding information stored on the central device?
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When the CYBLE_EVT_GAP_AUTH_FAILED occurs, it signifies that the remote device refused the authentication (most likely due to the bond being invalid).
When this occurs, I disconnect from the remote device; (wait until disconnect complete), then remove the bonded device. Once the flash finishes removing the old bond, I then reconnect with the BLE device and bond with it.
The order of events/function calls is as follows:
CYBLE_EVT_GAP_AUTH_FAILED event occurs
CyBle_GapDisconnect(cyBle_connHandle.bdHandle) function called
(wait until disconnect complete)
CyBle_GapRemoveBondedDevice(&pMainData.bondedDevice) function called
(wait until flash write/delete complete)
CyBle_GapcConnectDevice(&pMainData.bondedDevice) function called
(Then just re-bond with the device on reconnect)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
You can get the GetBondedDeviceList API to retrieve the list of the device you have bonded and check if the peripheral is in the list or not.
Regards,
- Madhu Sudhan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If I connect to a peripheral with bonded information stored, but the peripheral no longer has the bond information stored, what will happen? Is there a way to tell if the remote device no longer has the "matching" bond information? Or do I need to just catch an event for invalid bond information, and rebond?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Specifically, I'm looking for a way to re-write bond information stored in the RAM/flash data if the remote side refuses the current bond credentials.
Do I just re-attempy the CyBle_GapAuthReq() with authInfo set to CYBLE_GAP_BONDING_NONE to rerequest the bonding information?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Did you find a solution i would like to do a similar thing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When the CYBLE_EVT_GAP_AUTH_FAILED occurs, it signifies that the remote device refused the authentication (most likely due to the bond being invalid).
When this occurs, I disconnect from the remote device; (wait until disconnect complete), then remove the bonded device. Once the flash finishes removing the old bond, I then reconnect with the BLE device and bond with it.
The order of events/function calls is as follows:
CYBLE_EVT_GAP_AUTH_FAILED event occurs
CyBle_GapDisconnect(cyBle_connHandle.bdHandle) function called
(wait until disconnect complete)
CyBle_GapRemoveBondedDevice(&pMainData.bondedDevice) function called
(wait until flash write/delete complete)
CyBle_GapcConnectDevice(&pMainData.bondedDevice) function called
(Then just re-bond with the device on reconnect)