How to Autoconnect to a paired device (BLE) without scanning

房东的猫 提交于 2019-12-08 05:02:44

问题


We are developing a BLE application and we need a low power consumption. We need to connect devices in background processes so we are scanning all the time. This means that the power consumption is huge.

We know that Android OS connects automatically to some bluetooth devices as headsets or car free-hands devices and the power consumption of the phone keeps low.

Is there any way to use the same method that Android OS use?

We need to connect to the device as soon as it appears near the phone, and we need to measure the RSSI value constantly.

Is possible to reduce the Bluetooth power consumption with a constant search for BLE devices?


回答1:


I think my solution for similar question (of me) might help for autoconnection. Just save the MAC address of the BLE device into DB or something, and connect by using the MAC address when it needed. You can call connectGatt() periodically, when the app starts, or when it initializes something. But I don't have any idea for constant RSSI checking part. It might need constant scanning.



来源:https://stackoverflow.com/questions/30460012/how-to-autoconnect-to-a-paired-device-ble-without-scanning

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