当前位置:首页 > 技术心得 > 正文内容

android bluetoothGatt :onClientRegistered() - status=133 clientIf=0

xjtudll11年前 (2015-12-04)技术心得46640

参考资料:

http://stackoverflow.com/questions/25330938/android-bluetoothgatt-status-133-register-callback

http://stackoverflow.com/questions/28894111/android-ble-gatt-error133-on-connecting-to-device

问题:

BLE连接时(使用 .connectGatt),不是提示成功或失败,而是提示:

BluetoothGatt(32027): onClientRegistered() - status=133 clientIf=0

经查:

133 = 0x85,是GATT_ERROR

d7ccbb9d-5577-4e08-a98f-4e8a747e5075

错误含义

https://android.googlesource.com/platform/external/bluetooth/bluedroid/+/android-4.4.4_r2.0.1/stack/include/gatt_api.h

原因:

之前断开连接时,仅仅是调用了.disconnect(), 而没有调用.close().

BluetoothGatt一次最多只能处理6个连接(android4.4)。所以重复连接6次之后,就再也无法连接了。

解决办法:

每次重连前,BluetoothGat先调用.close(),这样可以释放所有的连接。

扫描二维码推送至手机访问。

版权声明:本文由鸟的天空发布,如需转载请注明出处。

本文链接:http://www.xjtudll.cn/Exp/375/

标签: AndroidBLE
分享给朋友:

“android bluetoothGatt :onClientRegistered() - status=133 clientIf=0” 的相关文章

C# 将程序添加开机启动的三种方式

原文:https://blog.csdn.net/arrowzz/article/details/69808761 前言 最近在研究程序随系统启动,发现在 win7 上因为权限的问题,写注册表的时候总是会出现问题,写不进去导致的不能自动启动,随后决定仔细的看一看这方面的问题。 查资料过程中主要发现有...

贴片电阻电容电感封装尺寸

贴片电阻电容电感封装尺寸

贴片常见封装有9种,用两种尺寸代码来表示。一种尺寸代码是由4位数字表示的EIA(美国电子工业协会)代码,前两位与后两位分别表示电阻的长与宽,以英寸为单位。我们常说的0603封装就是指英制代码。另一种是米制代码,也由4位数字表示,其单位为毫米。下表列出贴片电阻封装英制和公制的关系及详细的尺寸。...

如何统计SQL语句查询出来的条数

可以通过count函数来实现。 sqlOne:select * from tablename1 where id>5;此语句查询出来多条记录,之后看做一个新的表。 sqlTwo:select conut(*) from (select * from tablename1 where id>...

Android BLE:onServicesDiscovered(BluetoothGatt gatt, int status) 没有回调过

问题: .discoverServices()调用之后,却永远不回调onServicesDiscovered(BluetoothGatt gatt, int status) 基本代码如下: public void onConnectionStateChange(BluetoothGatt gatt...

SQL Server 数据类型xtype

xtype=34 'image' xtype= 35 'text' xtype=36 'uniqueidentifier' xtype=48 'tinyint' xtype=52 'smallint' xtype=56 'int' xtype=58 's...

android动态改变ActionBar中MenuItem的图标

先调用方法:invalidateOptionsMenu(); 然后系统会自动回调方法:onPrepareOptionsMenu 在onPrepareOptionsMenu中改变MenuItem的图标即可。 例如: MenuItem item = menu.findItem(R.id.share);...

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。