Bonding Peripheral to Multiple Centrals (PC) - Authentication Fail

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

cross mob
AdHi_1217611
Level 1
Level 1

I have a HID Input Device that can connect to a single PC just fine. As soon I take the BT dongle to my other PC and try to pair, it will not go through with the bonding.

When I debug it and put a breakpoint in "CYBLE_EVT_GAP_AUTH_FAILED", it will break there. If I completely re-program the flash from PSoC Creator, I can pair the device to either PC just fine, but only to one.

I am suspecting that once the controller has bonding data stored for PC-1 it will prevent pairing to PC-2.

Is it possible for a peripheral to be paired to multiple centrals?
Is there a way to delete bonding information when the code hits the "CYBLE_EVT_GAP_AUTH_FAILED" event?

0 Likes
1 Solution

Hello Adam,

Peripheral will store the bonding data of Central devices where it can store a maximum of 4 bonded devices. Here if you connect the BT Dongle to the PC and start pairing with the Peripheral then the peripheral will store the bonding data of the BT dongle (BT dongle acts as Central not PC). If you connect the same BT dongle to other PC it won't ask for the pairing again because BT dongle bonding data is already stored in the Peripheral.

If you reprogram the Peripheral then all the Bonding data of a Central devices will be lost so again the pairing process will takes place.

And the project which you shared is not building at my end. Is it building for you.

Thanks,

P Yugandhar.

View solution in original post

0 Likes
11 Replies
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello Adam,

Bonding is the process in which the keys and identity information exchanged during the pairing process for securing and encrypting the link are saved. After devices are bonded, they do not have to go through the pairing process again when reconnected. There can be a maximum of 4 bonded devices.

CyBle_GapRemoveBondedDevice (CYBLE_GAP_BD_ADDR_T *bdAddr) this function removes the bonding information of the device including CCCD values. This function is available only when Bonding requirement is selected in Security settings.

Can you please share your project.

Thanks,

P Yugandhar.

0 Likes

Hello psyu,

I did manage to put the CyBle_GapRemoveBondedDevice in the AUTH_FAILED event, which works as it will bond for the second try to the second PC.


I did read that there can be 4 bonded devices, but is this true for the Peripherals as well? For some reason I can't get bonded to multiple PC's reliably. There have been very few occasions after multiple tries it did bond but wasn't reliable.

How can I attach a .zip file?

0 Likes

Hello Adam,

In PSoC Creator, go to File->Create workspace Bundle->Select minimal. Please attach the generated file.

Thanks,

P Yugandhar.

0 Likes
lock attach
Attachments are accessible only for community members.

Hi,

Please see attached.

0 Likes

Hello Adam,

Can you please send Bootloader Project HEX & ELF files.

Thanks,

P Yugandhar.

0 Likes
lock attach
Attachments are accessible only for community members.

Thank you for your time, and please see the attached files.

0 Likes

Hello Adam,

Peripheral will store the bonding data of Central devices where it can store a maximum of 4 bonded devices. Here if you connect the BT Dongle to the PC and start pairing with the Peripheral then the peripheral will store the bonding data of the BT dongle (BT dongle acts as Central not PC). If you connect the same BT dongle to other PC it won't ask for the pairing again because BT dongle bonding data is already stored in the Peripheral.

If you reprogram the Peripheral then all the Bonding data of a Central devices will be lost so again the pairing process will takes place.

And the project which you shared is not building at my end. Is it building for you.

Thanks,

P Yugandhar.

0 Likes

Hi,

Even though I use the same BT dongle in both PC's, the controller wouldn't connect to both (even if the bonding data should be the same)

I will experiment more once I get my new modules assembled.

0 Likes

Hello,

Can you please check Authentication Failed Reason.

In the event CYBLE_EVT_GAP_AUTH_FAILED the return value of type CYBLE_GAP_AUTH_FAILED_REASON_T indicates the reason for failure.

Thanks,

P Yugandhar.

0 Likes

Hi,

I have a similar issue: I want to share data from a sensor to multiple devices (samrtphones) simultaneously.

Have you solved the above issue and are you willing to share your work?

Thanks for your reply,

Kris

0 Likes

Hello Kris,

PSoC 4 BLE devices supports only one connection at a time , so you can not connect multiple devices simultaneously over BLE.  But there are some approaches you may implement like - Instead of simultaneously , you can connect in time multiplexed fashion , or without establishing a BLE connection you may communicate through Broadcast packets etc.

Please refer to below GitHub code examples for more information.

Link: PSoC-4-BLE/100_Projects_in_100_Days at master · cypresssemiconductorco/PSoC-4-BLE · GitHub

Thanks,

P Yugandhar.

0 Likes