Passkey authentication error with custom key entry from app

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

cross mob
ToVa_285016
Level 5
Level 5
100 replies posted 50 replies posted 50 questions asked

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

0 Likes
1 Solution
Anonymous
Not applicable

Hi Tom,

   

Try "001234" on the phone side. Passkeys in all modern Bluetooth systems (everything newer than the v2.0 spec, which is now over 10 years old) must be six digits. If the decimal value is less then 100000 or, in your case, less than 10000, then you need to supply leading zeros during entry.

   

Jeff

View solution in original post

0 Likes
1 Reply
Anonymous
Not applicable

Hi Tom,

   

Try "001234" on the phone side. Passkeys in all modern Bluetooth systems (everything newer than the v2.0 spec, which is now over 10 years old) must be six digits. If the decimal value is less then 100000 or, in your case, less than 10000, then you need to supply leading zeros during entry.

   

Jeff

0 Likes