BLE pairing fails on Android

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

cross mob
JeHu_3414236
Level 5
Level 5
10 likes received First like received

I setup my device as a BLE keyboard with security settings Mode 1/Unauthenticated with encryption/IO Display Only/Bonding required.  I can pair in Windows 10 but it fails on both Android 6.x and 8.x I tested with.  I can see in the BLE capture that after I send the Pairing Response to the phone, the phone sends the Pairing Confirm after 300ms.  It does not wait for the user to enter the passkey displayed on my device.  On Windows it waits until I type in the passkey to send the Pairing Confirm.  Does anyone know what the problem is?

0 Likes
1 Solution

Looks like the mismatch in GAP Appearance as Keyboard and IO Capabilities as display confuses Android making it think if it is a display device or a keyboard which causes pairing to fail. This seems to be a bug in Android. You can run your application using GAP Appearance as "Unknown" and IO Capabilities set to "Display" and it should work.

Regards,

Dheeraj

View solution in original post

0 Likes
4 Replies
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

We will be debugging your issue. Until then please provide your phone specifications along with the Bluetooth version.

Regards,

Dheeraj

0 Likes

I am using Galaxy S6 Android 6.0 and Huawei Mate SE Android 8.0.  I changed the GAP appearance in advertising to generic display and it works.  It didn't work when it was set to HID Keyboard.  I think Android forces the user to enter the passkey on the HID device side regardless of the I/O capabilities if it is set as a HID keyboard based on GAP appearance.  Can you confirm this is the case?  I only have these 2 phones to test with and it seems like it.  Thanks.

0 Likes

Yes, your observations are right. We are testing across different phones and configurations and trying to debug the issue.

Regards,

Dheeraj

0 Likes

Looks like the mismatch in GAP Appearance as Keyboard and IO Capabilities as display confuses Android making it think if it is a display device or a keyboard which causes pairing to fail. This seems to be a bug in Android. You can run your application using GAP Appearance as "Unknown" and IO Capabilities set to "Display" and it should work.

Regards,

Dheeraj

0 Likes