1 Reply Latest reply on Jul 12, 2017 10:05 AM by madhul_36

    BLE Authentication Issues For Passkey




      I have a couple of issues/questions for a fixed passkey security application with an Android app.

      • In the android app, two pairing windows pop up one after the other, the first just gives the option to cancel or pair, and the second has passkey entry.  I have not seen this from other devices, how do I just get the passkey entry window to open?  is this a security setting?
      • I have a device that is paired, disconnect, and reconnect and have to pair again.  Any reason I would have to enter passkey info again?
      • If I select a device in the app from a list of paired devices, it connects without the pairing dialog popping up, but then disconnects after a short time saying that it could not authenticate, and the device disappears from paired devices on the app.
      • How can I confirm a paired connection is made with a device?  CYBLE_EVT_GATT_CONNECT_IND fires even if the authentication hasn't happened, and CYBLE_EVT_GAP_AUTH_COMPLETE fires only when the pairing dialog comes up (not if connecting to a previously paired device).

      See attached for the BLE portion of the code


      Thank you for your input.





        • 1. Re: BLE Authentication Issues For Passkey



          When you par with a phone for the first time, you need to enter the passkey. (If you do not see the passkey window, it might sometimes come up in the notification bar of your mobile. You need to drag down to see the window).


          Once paired, the pairing information will be stored in the mobile. This is called bonding (You can see this in Bluetooth Settings -> My Devices). If the pairing information is also stored in the device (bonding option enabled in the firmware), you do not have to enter passkey everytime from then on.


          If the bonding info is done in mobile and not in the device, you might have to enter the passkey again or the pairing may fail depending upon the scenario.


          If you remove the bonding info in the device (during reprogramming the firmware or manually removing bonding info in the firmware), you might have to remove the same in the mobile also. (In Bluetooth Settings).


          Refer to the below example project for bonding.






          -Madhu Sudhan