小编him*_*tel的帖子

BLE设备绑定在Android中自动删除

我们正在做下面的过程做对与BLE装置.

Connect()+ discoverServices()+ Pairing(Bonding).

有时Android操作系统以奇怪的方式取消配对我们的BT设备,即:

  • 而不发送广播通知该键合状态已经改变
  • 甚至系统蓝牙设置应用程序认为设备仍然配对
  • 只有bt重新启动(关闭并打开通过设置应用程序)刷新状态并显示设备不再配对

当设备成功配对的ACTION_BOND_STATE是如下改变.

[6:19:28 PM] Himen Patel:04-09 18:18:27.325:D/BluetoothGatt(8380):onCharacteristicWrite() - Device = C2:69:E9:57:93:A4 UUID = 860b2c07-e3c5- 11e2-a28f-0800200c9a66状态= 5 04-09 18:18:27.365:E/millisUntilFinished(8380):millisUntilFinished = 15 04-09 18:18:28.105:E/BelwithDeviceActor(8380):债券状态改为:C2: 69:E9:57:93:A4新状态:11上一个:10

04-09 18:18:28.105:E/millisUntilFinished(8380):millisUntilFinished = 20 04-09 18:18:29.135:E/millisUntilFinished(8380):millisUntilFinished = 18 04-09 18:18:30.135:E/millisUntilFinished (8380):millisUntilFinished = 17 04-09 18:18:31.145:E/millisUntilFinished(8380):millisUntilFinished = 16 04-09 18:18:32.145:E/millisUntilFinished(8380):millisUntilFinished = 15

04-09 18:18:33.105:D/BluetoothGatt(8380):onCharacteristicWrite() - Device = C2:69:E9:57:93:A4 UUID = 032a0000-0000-0000-0000-000000000000 Status = 137 04-09 18:18:33.115:E/BelwithDeviceActor(8380):C2:69:E9:57:93:粘结状态改变A4新的状态:12前:11

04-09 18:18:33.115:I/System.out(8380):unregisterReceiver true

现在,当操作系统以奇怪的方式删除配对时,ACTION_BOND_STATE将如下更改..... 债券状态改为:C2:69:E9:57:93:A4新状态:10.

我们也在我们的APP中立即获得了act = android.bluetooth.device.action.ACL_DISCONNECTED flg = 0x4000010的事件.

这里有什么重要的,在这一点上,我们失去了与设备的配对,受保护的特性对我们来说不再适用.如果我们使用系统设置应用程序或BluetoothAdapter :: …

android bluetooth bluetooth-lowenergy

14
推荐指数
1
解决办法
1万
查看次数

标签 统计

android ×1

bluetooth ×1

bluetooth-lowenergy ×1