FastBle报错

2022-07-06  本文已影响0人  星_025f

参考:https://blog.csdn.net/Guceekll/article/details/123203725
参考:https://www.i4k.xyz/article/qq_21071977/108972406
参考:https://blog.csdn.net/baidu_26352053/article/details/54571688
参考:https://blog.csdn.net/weixin_44068690/article/details/116041455

BluetoothGattCallback:onConnectionStateChange status: 22  newState: 0  currentThread: 144
发生原因:断开连接后重新连接间操作过快导致
解决办法:断开连接后增加限制连接间隔时间
 BluetoothGatt: onClientConnectionState() - status=133 clientIf=6 device=******************
 status: 133
 newState: 0
 currentThread: 152
 连接失败====101=====Gatt Exception Occurred! 

 发生原因:频繁操作断开重连

一:安卓版本问题,缺少了参数
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
                        mBluetoothGatt = bluetoothDevice.connectGatt(MainActivity.this,
                                true, gattCallback, TRANSPORT_LE);
                    } else {
                        mBluetoothGatt = bluetoothDevice.connectGatt(MainActivity.this,
                                true, gattCallback);
}

二:Gatt调用close释放资源
三:系统硬件有关
BluetoothGatt: onClientConnectionState() - status=8 clientIf=5 device=******************
status: 8
newState: 0
currentThread: 144  

https://blog.csdn.net/weixin_44068690/article/details/116041455
上一篇下一篇

猜你喜欢

热点阅读