This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

关于自动连接问题



工作在Peripheral角色的BLE设备。

准备于手机连接,配对问题解决了,现在的问题是如何让配对过的手机在进入信号范围内主动来连接,就像蓝牙耳机一样。

iPhone试过可以自动来连接,但是andriod和Windows phone不行。

需要设置什么参数吗?

  • 我对安卓系统了解不多,从我查阅的资料看应该是可以实现自动连接的,以下摘自网络: 为了连接到BLE设备上的GATT服务端,需要使用connectGatt( )方法。这个方法需要三个参数:(1) 一个Context 对象,(2)autoConnect(boolean,表示当蓝牙可用时是否自动连接BLE 设备)(3)一个BluetoothGattCallback mBluetoothGatt = device. 地址: https://www.google.com.hk/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&uact=8&ved=0CCMQFjAB&url=http%3A%2F%2Fwenku.baidu.com%2Fview%2Fef20b1ddec3a87c24028c483.html&ei=3gY2VIzFBIPo8gW6iYCwAg&usg=AFQjCNFSelYt15JNxit97YABxSAEt1Hylw&bvm=bv.76943099,d.dGc