Change the settings to Unauthenticated pairing with encryption
Unauthenticated pairing with encryption doesn't work for me.
After long work, I found the way to connect my Tablet to my BLE periferal device with paring but now the
the tablet shows the passKey for paring and the BLE sends the required passKey to Tablet with CyBle_GapAuthPassKeyReply API.
I changed the GAP Security I/O capabilities to Keyboard and Display.
In the attachment file ZIP you can find a modified version of Day_015_Bonding example where I changed the code and the BLE configuration to reach this goal.
With this version I am able to pairing my BLE device in this way:
From Settings-> Bluetooth tablet menu I can choose my BLE device and when I select the device, the tablet shows the passKey .
Now enter the passKey in to the serial console and the pairing/bonding process will go on.
The StackEvent on my BLE device receive this event series:
Advertisement is enabled
CYBLE_EVT_GAP_AUTH_REQ: security=0x2, bonding=0x1, ekeySize=0x10, err=0x0
This operation Mode is not what I want.
I want show the passKey on my BLE peripheral device and enter the passKey in my tablet.
How can I reach this goal?
I think the first step is to set the GAP Security I/O capabilities to Display, but what else?
Hi Giorgio! I have also looked through the bonding example project in the 100 project/day and been wondering if the code for handling the
CYBLE_EVT_GAP_AUTH_REQevent is wrong. The API documentation says that
CyBle_GappAuthReqReplyshould be called, but that example does not call it. (I have not tried to run the example on a device).
I see your code calls
CyBle_GappAuthReqReply. You use the global variable
cyBle_authInfoas argument. Could this variable's member
authErr :: CYBLE_GAP_AUTH_FAILED_REASON_Tbe different from
CyBle_GappAuthReqReplyshould be called by a local variable created just for the call, or the one from casting the
void*given to the event handler function. I don't know. It would be nice to clarify this :)
Recently, I was surprized that the Cypress generated function CyBle_EventHandler() is the actual event handler, and this just calls our custom handler, set by CyBle_Start( &my_handler ), at end. And I see in the source code that the CyBle_EventHandler calls CyBle_GappAuthReqReply(), I thought our custom event handler overrided the Cypress one. I have not seen any documentation that CyBle_EventHandler is always called, and I've been developing on PSoC4BLE for months. I have to contact support about that!
Any news about issue ?
Is There Anybody Out There?