Pre-pairing bluetooth devices

允我心安 提交于 2019-12-04 17:57:41

问题


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?


回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/32235854/pre-pairing-bluetooth-devices

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!