1 Reply Latest reply on Jun 3, 2017 6:46 AM by jrow

    Passkey authentication error with custom key entry from app

    user_385543602

      Hi,

         

      I am trying to have my BLE device connect to my app with a simple password setup.  I have set the password to '1234' using the following code:

         

              case CYBLE_EVT_STACK_ON:
                  // When stack comes on, set correct ECO capacitance trim value
                  // http://www.cypress.com/knowledge-base-article/eco-capacitance-trim-values-ez-ble-modules-kba218990
                  CY_SET_XTND_REG32((void CYFAR *)(CYREG_BLE_BLERD_BB_XO_CAPTRIM), 0x9898);
                  // Set password
                  CyBle_GapFixAuthPassKey(TRUE,dataLocal.pinCode);
                  
                  // Start advertisement
                  CyBle_GappStartAdvertisement(CYBLE_ADVERTISING_FAST);
                  break;

         

      I have confirmed that this is indeed the pin here:

         

              case CYBLE_EVT_GAP_PASSKEY_DISPLAY_REQUEST:
                  // Check passkey
                  passkey = *(uint32 *)eventParam;
                  break;

         

      'passkey' is decimal '1234', 0x4D2 hex.

         

      When my app is prompted and I enter '1234' into the passkey entry, the connection fails for the following reason:

         

      CYBLE_GAP_AUTH_ERROR_CONFIRM_VALUE_NOT_MATCH 

         

      I don't know how I can see what the BLE saw for the entered passkey to check what went wrong.  Any ideas?

         

      Thank you for your comments.

         

      Regards,

         

      Tom