Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

use Jelly Bean's Simple Secure Pairing ( Bluetooth ) to pair with NFC

As of #io2012 and JellyBean doc there is now a way to pair bluetooth devices via NFC.

That sounds really nice, but I cannot find any documentation about it.

I am especially interested to know if that works with SPP modules that do not support SDP - can I simply write some NFC tag with the PIN-Info and the device gets paired? Would help a lot as a lot of users, that have problems with the PIN-pairing process.

like image 653
ligi Avatar asked Jul 16 '12 07:07

ligi


3 Answers

There are two kinds of Bluetooth pairing NDEF messages that are supported by JellyBean. The standardized one defined by the Bluetooth SIG together with the NFC Forum and the (older) proprietary one defined by Nokia (see "What is the tag format to connect the Nokia 6131 NFC with a Bluetooth imaging device?" at http://www.developer.nokia.com/Community/Wiki/Nokia_6131_NFC_-_FAQs#SDK_APIs for some details).

The standardized one does not provide support for PIN. It only supports the new Simple Pairing method. The Nokia-type message has support for PIN. However, when reading the relevant source code from Android that parses such Bluetooth paring NDEF messages (parseNokia() in HandoverManager) you can see that the PIN is not even read out from the NDEF message. So in the end only the built-in PINs in the Android Bluetooth manager will be tried (default ones like 0000 and 1234) to set up a connection if the device is not already known and paired earlier before reading the tag (in which case the NFC tag merely functions as a way to activate the connection).

I also have the impression that this new functionality in Android is firstly supposed to work with audio devices such as head sets. I cannot tell whether it also works with SSP devices (no device to test with myself).

like image 103
NFC guy Avatar answered Nov 11 '22 20:11

NFC guy


Yes, you can quite simply create an NFC tag with Bluetooth pairing information. Anyhow it will only work for now when the device uses a default pin as Android will only try the default pin 0000 to what I know. you can program such a tag using the NFC TagWriter by NXP.

like image 22
ItsMAAndroid Avatar answered Nov 11 '22 18:11

ItsMAAndroid


You might want to have a look at Stanford's EasyNFC library on GitHub.

Especially the BluetoothConnector seems interesting as it "Helps developers set up long-lasting Bluetooth connections across devices".

like image 41
keyboardsurfer Avatar answered Nov 11 '22 18:11

keyboardsurfer