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:
// When stack comes on, set correct ECO capacitance trim value
CY_SET_XTND_REG32((void CYFAR *)(CYREG_BLE_BLERD_BB_XO_CAPTRIM), 0x9898);
// Set password
// Start advertisement
I have confirmed that this is indeed the pin here:
// Check passkey
passkey = *(uint32 *)eventParam;
'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:
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.
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.