1 Reply Latest reply on Aug 5, 2020 1:43 AM by GaneshD_41

    Authenticated LE Secure Connection with Numeric Comparison

    EdHa_4455331

      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.

        • 1. Re: Authenticated LE Secure Connection with Numeric Comparison
          GaneshD_41

          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