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.
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).
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.
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".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With