Question

I am using the listenUsingInsecureRfcommWithServiceRecord and createInsecureRfcommSocketToServiceRecord calls in order to connect one Android device to another.

On the first setting I had a Nexus One and a Nexus S both running Android 2.3.6 - on this setting, connecting did not pop "Pairing Request" Dialog.

On the second setting I tried the same Nexus One with a Samsung Galaxy S2 running Android 2.3.3 - on this setting the "Pairing Request" dialog did pop on both devices. This is weird as both devices are on API level 10 which is supposed to support insecure connection.

Did anyone else bump into this strange behavior? Can someone verify that this is a problem in 2.3.3, or perhaps in the specific model I tested? Is there any workaround?

If necessary I can post relevant parts from the logcat.

Était-ce utile?

La solution

Per Bluetooth v2.1, GAP, section 5.2.2:

When both devices support Secure Simple Pairing, GAP shall default to requiring an unauthenticated link key and enabling encryption.

So to enable encryption Bluetooth needs to create a link-key... Thus the need for SSP pairing.

Don't know whether its possible to avoid that in Android.

Otherwise handle the authentication event and confirm the pair -- the pair will very likely the "Just Works" form which just requires confirmation (no passkeys etc).

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top