I'm a starter at PSOC and Bluetooth, please excuse me for maybe trivial question. I was working on ble workshop and i succesfully run lab1-2-3. But there is not any instance about authentication. I have set my ble component as gap peripheral and changed the security level to "authenticated pairing with encryption" but i didn't understand how can i configure the passkey? Is there any simple example about pairing with passkey? I just want to pair with a passkey with my master(gap central device) then let it read 1 byte device id from peripheral device.
Solved! Go to Solution.
I have found the BLE_Bonding application at "100 projects at 100 days" section. Here is what i didn't understand. Whenever the cysmart sends passkey request, the pioneer kit sends passkey from uart and i can enter it from cysmart. But how can i set constant passkey? I added the code block from passkey displaying, i don't understand that creates the passkey randomly or something?
Here is the code block:
printf("CYBLE_EVT_GAP_PASSKEY_DISPLAY_REQUEST. Passkey is: %d%d.\r\n",
HI16(*(uint32 *)eventParam), LO16(*(uint32 *)eventParam));
printf("Please enter the passkey on your Server device.\r\n");
I found this function at API document:
CyBle_GapGetPeerDevSecurityKeyInfo(uint8 bdHandle, uint8 * keysFlag, CYBLE_GAP_SMP_KEY_DIST_T * keyInfo);
But i don't know how can i use the *keysFlag and *keyInfo
Random keys are generated for Pairing. Please have a look at: https://github.com/cypresssemiconductorco/PSoC-4-BLE/tree/master/100_Projects_in_100_Days/Day017_Pri...
to understand the usage of CyBle_GapGetPeerDevSecurityKeyInfo
I was looking for a documantation about using constant passkeys but i have learned that we can not use constant passkeys for now. Thank you for you response anyway 🙂