xiaoyaoyou1212 / BLE

✨Android BLE基础操作框架,基于回调,操作简单。包含扫描、多连接、广播包解析、服务读写及通知等功能。
http://www.huwei.tech/
Apache License 2.0
1.38k stars 364 forks source link

gattStatus=133错误 #60

Open chengxinping opened 6 years ago

chengxinping commented 6 years ago

断开设备再连接设备 很大概率会报这个错误 ,请问怎么解决 ConnectException{gattStatus=133, bluetoothGatt=android.bluetooth.BluetoothGatt@96a77c1} BleException{code=CONNECT_ERR, description='Connect Exception Occurred! '}

KaJunChan commented 6 years ago

我也有这个情况,使用了网上的说的,disconnect后再close的方式也不行

jinjidecj commented 5 years ago

断开设备再连接设备 很大概率会报这个错误 ,请问怎么解决 ConnectException{gattStatus=133, bluetoothGatt=android.bluetooth.BluetoothGatt@96a77c1} BleException{code=CONNECT_ERR, description='Connect Exception Occurred! '}

请问你这问题解决了吗

jinjidecj commented 5 years ago

同样会报133错误,我在安卓4.4的板子上运行这个demo,会报这样的错误,但是在别的系统上就不会。

jinjidecj commented 5 years ago

我也有这个情况,使用了网上的说的,disconnect后再close的方式也不行

请问你这个情况解决了吗

chengxinping commented 5 years ago

我也有这个情况,使用了网上的说的,disconnect后再close的方式也不行

请问你这个情况解决了吗

我回来换库了 用的fastBLE 没这个问题了

WhaleDev commented 5 years ago

除了换库还有什么方法可以解决啊,求告知! #

zhukai78 commented 4 years ago

已解决,根据版本修改连接方式:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { bluetoothGatt = bluetoothLeDevice.getDevice().connectGatt(ViseBle.getInstance().getContext(), false, coreGattCallback, TRANSPORT_LE); } else { bluetoothGatt = bluetoothLeDevice.getDevice().connectGatt(ViseBle.getInstance().getContext(), false, coreGattCallback); }