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

PSoC™ 6 Forum Discussions

l_diserio
Level 1
5 sign-ins First reply posted First question asked
Level 1

Hello,

I'm using CY8cPROTO-063-BLE PSoC 6 BLE PROTOTYPING KIT with CYBLE-416065-0243-SMT which sends and receives some values over BLE from an APP Cysmart.

The device is configured as follows:

GAP role: Peripheral
Type of advertising:
Filter Policy: Scan Request: Any | Connect Request Any
Map of advertising channels: All channels
Fast advertising interval
Minimum (ms) 20
Maximum (ms): 30
Check Timeout (s): 30

Security Mode: Mode 1
Security level: Authenticated pairing with encryption
Encryption key size (bytes): 1

The device connects correctly with the app and the pairing procedure works correctly. At the end of the connection the bonding is saved correctly.

But if the device subsequently establishes a another connection always with the same smartphone, with the CySmart app, the smartphone's operating system requests the pairing password again even if the bonding procedure was previously successful.

How I can risolve this problem ?

Thanks in advance for any replies.

Lucia

0 Likes
3 Replies
PratikshaV
Moderator
Moderator 100 replies posted 25 solutions authored 100 sign-ins
Moderator

Hi @l_diserio 

I hope 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.

if this doesn't work please can you share your code so that we can check at our end.

 

Thanks & Regards

Pratiksha V

0 Likes
l_diserio
Level 1
5 sign-ins First reply posted First question asked
Level 1

Hi @PratikshaV .

thanks for your reply.

check  "cy_ble_pendingFlashWrite", after Cy_BLE_ProcessEvents, and only when this variable is non-zero, I call "Cy_BLE_StoreBondingData()" API.

But this doesn't work. I share my code .

How I can risolve this problem ?

Thanks in advance for any replies.

Lucia

0 Likes
PratikshaV
Moderator
Moderator 100 replies posted 25 solutions authored 100 sign-ins
Moderator

Hi @l_diserio 

I tried to build your shared code but unfortunately I was not able to build it successfully please can you check the attached code example.

 

Thanks & Regards

Pratiksha V

0 Likes