Authenticated LE Secure Connection with Numeric Comparison

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

cross mob
EdHa_4455331
Level 5
Level 5
25 replies posted 25 sign-ins 10 replies posted

I am trying to set up Bluetooth LE pairing using Authenticated LE Secure pairing with encryption and Numeric Comparison. In the generic BLE event handler, I can get to:

        case CY_BLE_EVT_GAP_NUMERIC_COMPARISON_REQUEST:

           

            BLE_PRINTF("Compare this passkey with the one displayed in your peer device and press 'y' or 'n':"

                       " %6.6lu \r\n", *(uint32_t *)eventParam);

It is fairly obvious that I should insert my own application specific code at this point to present the question to the user in way that is supported on my system. And I can handle that.

However, what is NOT obvious to me is how I am supposed to acknowledge the user's confirmation that the pairing should proceed. It seems like there should be some predefined CY_BLE function to call, but I can't locate it.

Anybody know how to complete the Numeric Comparison?

Thanks,

Ed h.

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi Ed,

>>"It is fairly obvious that I should insert my own application specific code at this point to present the question to the user in way that is supported on my system. And I can handle that."

Cypress--> You just have to set the security mode as "Authenticated pairing with LE secure connections" in the BLE configurator tab. The BLE stack can generate a code and display it on both central and peripheral devices. However you can also set the passkey using the API CyBle_GapFixAuthPassKey().

The API CyBle_GapAuthPassKeyReply(cyBle_connHandle.bdHandle, numcompkey, CYBLE_GAP_ACCEPT_PASSKEY_REQ); is used to return the status (correct/incorrect) of the passkey entered from the user.

Please find the attached projects which has the implementation for Numeric comparison method.

Thanks

Ganesh

View solution in original post

0 Likes
1 Reply
lock attach
Attachments are accessible only for community members.
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi Ed,

>>"It is fairly obvious that I should insert my own application specific code at this point to present the question to the user in way that is supported on my system. And I can handle that."

Cypress--> You just have to set the security mode as "Authenticated pairing with LE secure connections" in the BLE configurator tab. The BLE stack can generate a code and display it on both central and peripheral devices. However you can also set the passkey using the API CyBle_GapFixAuthPassKey().

The API CyBle_GapAuthPassKeyReply(cyBle_connHandle.bdHandle, numcompkey, CYBLE_GAP_ACCEPT_PASSKEY_REQ); is used to return the status (correct/incorrect) of the passkey entered from the user.

Please find the attached projects which has the implementation for Numeric comparison method.

Thanks

Ganesh

0 Likes