PSoC 6 BLE Bonding example?

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

cross mob
AnCi_2234676
Level 4
Level 4
10 replies posted 5 replies posted 10 questions asked

Hi,

Does anyone have an example project for bonding with PSoC 6 BLE?

I am using unauthenticated pairing with encryption. After receiving the CY_BLE_EVT_GAP_AUTH_COMPLETE event, I store bonding data to flash. This seems to work, but if I turn off BT on my phone and then on again, my device disappears from the paired device list.

What am I missing?

0 Likes
1 Solution
MeenakshiR_71
Employee
Employee
100 likes received 50 likes received 25 likes received

Hello antoine.cimonfortier_2234676​,

Many PSoC 63 "BLE examples" that ship with PSoC Creator implement bonding. For instance you can refer to CE212742.

Now, before you store the bonding data, you need to check a variable "cy_ble_pendingFlashWrite". Only when this variable is non-zero, you should call "Cy_BLE_StoreBondingData()" API. You cannot store bonding data if this variable is 0. Hence in your main code, after you call the Cy_BLE_ProcessEvents, you can check if the variable is non-zero or not. If it is non-zero, you can call the "Cy_BLE_StoreBondingData()" API.

Let me know if this helps.

Regards,

Meenakshi Sundaram R

View solution in original post

0 Likes
1 Reply
MeenakshiR_71
Employee
Employee
100 likes received 50 likes received 25 likes received

Hello antoine.cimonfortier_2234676​,

Many PSoC 63 "BLE examples" that ship with PSoC Creator implement bonding. For instance you can refer to CE212742.

Now, before you store the bonding data, you need to check a variable "cy_ble_pendingFlashWrite". Only when this variable is non-zero, you should call "Cy_BLE_StoreBondingData()" API. You cannot store bonding data if this variable is 0. Hence in your main code, after you call the Cy_BLE_ProcessEvents, you can check if the variable is non-zero or not. If it is non-zero, you can call the "Cy_BLE_StoreBondingData()" API.

Let me know if this helps.

Regards,

Meenakshi Sundaram R

0 Likes