11

I would like to be able to pre-pair bluetooth devices, to save the step of user confusion when using the app. I have discovered that there is a patent for System, method and apparatus for pre-pairing bluetooth enabled devices.

I am looking at pairing an array of android devices with an array of embedded devices, so when the android device is set up, I can pre-pair it with the devices it needs to communicate with. I have considered maintaining a list of MAC-addresses that can be downloaded and updated by the app.

Is there a way to pair two devices without having to bring them into contact?

Nemo
  • 2,441
  • 2
  • 29
  • 63
  • 1
    Just because there is a patent on something does not mean that off-the-shelf commodity hardware is capable of doing it. Otherwise, we would not need batteries, as a surprising number of perpetual motion machines have been patented. That being said, I have not delved much into Android Bluetooth API, so while I will be stunned if what you want is possible, I cannot rule it out. Also, if these Android devices are ones your firm built, or applied your own custom ROM to, I would focus on trying to pre-pair at the system level. – CommonsWare Aug 31 '15 at 11:09
  • My memory is not exact, it's a while ago I poked around in the Bluetooth stack, but, I don't think this is possible. Basically there is a white list (text file pretty much) which is kept by the system with devices that may connect to your phone, in order to access that white list outside of the Bluetooth api you need to be platform manufacturer. The Bluetooth Api is strongly guarded (by the specification), if you don't fulfill it you can't say your decide supports Bluetooth. Pairing is an important part of the Bluetooth security model, I doubt even an oem would be allowed to do this. – JohanShogun Aug 31 '15 at 21:01
  • One thing you could look into are Bluetooth low energy devices, those don't require pairing prior to connection (you should be able to connect if you have the MAC address), only Bluetooth classic requires pairing. – JohanShogun Aug 31 '15 at 21:05
  • 1
    Made it into an answer – JohanShogun Sep 01 '15 at 05:24
  • Perhaps [programmatically pairing](https://stackoverflow.com/q/17168263/650881) would address the underlying problem? – user650881 Sep 05 '15 at 00:57
  • 1
    A nice use-case. It reminded me one of BT-based project in early Y2K years, which died right due to growing and growing security-motivated restrictions and growing complexity of interactions + handshaking + PIN + timeouts, driving the whole Bluetooth device handling user-experience out of the comfort-zone of even tech-gurus ( the more us, the ordinary mortals ). The BT-toys simply ceased to be used at all. – user3666197 Jan 03 '17 at 06:45

2 Answers2

9

My memory is not exact, it's a while ago I poked around in the Bluetooth stack, however, I don't think this is possible.

Basically there is a white list (text file pretty much) which is kept by the system with devices that may connect to your phone, in order to access that white list outside of the Bluetooth api you need to be platform manufacturer. The Bluetooth Api is strongly guarded (by the specification), if you don't fulfill it you can't say your device supports Bluetooth. Pairing is an important part of the Bluetooth security model, I doubt even an oem would be allowed to do this.

One thing you could look into are Bluetooth low energy devices, those don't require pairing prior to connection (you should be able to connect if you have the MAC address), only Bluetooth classic requires pairing.

More info: https://developer.android.com/guide/topics/connectivity/bluetooth-le.html

JohanShogun
  • 2,956
  • 21
  • 30
3

No its not possible unless you make changes to the ROM.

If the use-case supports,you can have ble devices advertising data in a pre-defined format so that the app detect your devices.Once you have recognized your devices,you can internally send a pairing request.

rupesh jain
  • 3,410
  • 1
  • 14
  • 22