Handling Unilateral Bond Removal

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

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?

0 Likes
1 Solution
Anonymous
Not applicable

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)

View solution in original post

0 Likes
5 Replies
Anonymous
Not applicable

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

0 Likes
Anonymous
Not applicable

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?

0 Likes
Anonymous
Not applicable

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?

0 Likes
DeTo_1826166
Level 3
Level 3
First like received First like given

Hello,

Did you find a solution i would like to do a similar thing

0 Likes
Anonymous
Not applicable

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)

0 Likes