【发布时间】:2015-10-04 16:30:01
【问题描述】:
我正在开发一个 Android 应用程序来连接蓝牙模块双模式。
由于模块是双模式,我遇到了与here描述的相同的问题。
但是我试图做一个解决方法,因为在第一次连接后回调 onConnectionStateChange() 返回状态 133。总是在 Main Activity 的 onStop() 方法中,我关闭 BluetoothGatt 对象以释放资源。在 bluetooth.close() 之前进一步添加了 bluetoothGatt.disconnect()。
当调用disconnect()时,我的手机与模块建立了更多的连接,但是有时在重新连接后,回调onConnectionStateChange返回状态22。
我在 BluetoothGatt 文档中没有找到关于状态 22 的信息。
更新 BLE callbacks are passed status codes that are not in the public API. 的话题是关于状态 22 等。
谢谢
【问题讨论】: