4 Replies Latest reply on Feb 10, 2019 6:17 AM by AnKr_1499391

    Access BLE characteristic without pairing

    AnKr_1499391

      Hi everyone,

       

      I have a BLE device which is connected to an epaper-display. This is used to display the key to pair with a smartphone. Works fine and smooth.

       

      My problem now is, that I would like to make one characteristic accessible before I actually pair with the device to be able to select the correct display size.

      In the BLE configurations dialog in the profiles tab I set the permissions of the respective characteristic for read and write to "no encryption required, no authentication required, no autorization required". And I hoped that this would allow me to access the characteristic without pairing and bonding.

       

      I use an Android smartphone to connect to the device. But if I try to connect to the device I will always get a bonding request and if I decline this request I immediately get disconnected. I tried it with the CySmart and the nRF Connect app.

       

      Now I don't have a glue where the problem might be: Wrong configuration of the BLE-Component? Wrong handling of the connection request? Android-problem? App-problem? Usecase not possible at all?

       

      Thanks for any hint!

      Andreas

        • 1. Re: Access BLE characteristic without pairing
          PY_21

          Hello Andreas,

           

          In order to remove pairing, in BLE component -> in the security tab please change security mode:1, Security level: no security(No authentication, No encryption), strict pairing: No, I/O Capabilities: No input No output, Bonding requirement: No bonding.

          And also in the firmware please remove the API CyBle_GapAuthReq() which is responsible for generating pairing request.

          Please let me know if I'm missing anything.

           

          Thanks,

          P Yugandhar.

          • 2. Re: Access BLE characteristic without pairing
            AnKr_1499391

            Hi Yugandhar,

             

            thanks for this idea, but I don't want to completely disable pairing and bonding.

             

            I just want to be able to read and write one characteristic before I actually pair and bond to the device.

             

            Thanks

            Andreas

            • 3. Re: Access BLE characteristic without pairing
              PY_21

              Hello Andreas,

               

              In the event CYBLE_EVT_GAP_AUTH_REQ we have to call CyBle_GappAuthReqReply() function. This event is received by Peripheral and Central devices. When it is received by Peripheral, peripheral needs to Call CyBle_GappAuthReqReply() to reply to authentication request from Central device.

              CyBle_GappAuthReqReply() function is used to pass security information for authentication in reply to an authentication request from the master device.

              Please find the attached project, which has two custom characteristics(both has read and write). The first custom characteristic was enabled with encryption and second characteristic was enabled with No encryption and No authentication.

              Please let me know if this helps.

               

              Thanks,

              P Yugandhar.

              • 4. Re: Access BLE characteristic without pairing
                AnKr_1499391

                Hi Yugandhar,

                 

                thank you very much for this sample project. This is really the function I would like to have.

                I will have to check what the difference to my project is! :-)

                 

                Thanks

                Andreas