android 蓝牙低功耗状态 = 59
android bluetooth low energy status = 59
我的 android 应用程序在中央连接到外围设备时运行,启用通知并且外围设备开始发送。
我的问题是连接在大约 13 秒后终止。
下面我有 logcat 信息。
Android 中蓝牙 LE 的状态 59 是什么?
BluetoothGatt: connect() - device: C5:7F:B0:8E:AA:91, auto: false
BluetoothGatt: registerApp()
BluetoothGatt: registerApp() - UUID=3a9c080d-ae20-47ea-b34c-7ea7798204cc
BluetoothGatt: onClientRegistered() - status=0 clientIf=5
BluetoothGatt: onClientConnectionState() - status=0 clientIf=5 device=C5:7F:B0:8E:AA:91
BluetoothGatt: discoverServices() - device: C5:7F:B0:8E:AA:91
BluetoothGatt: onSearchComplete() = Device=C5:7F:B0:8E:AA:91 Status=0
BluetoothGatt: setCharacteristicNotification() - uuid: 00002a05-0000-1000-8000-00805f9b34fb enable: true
BluetoothGatt: setCharacteristicNotification() - uuid: 00001625-1212-efde-1523-785feabcd123 enable: true
BluetoothGatt: cancelOpen() - device: C5:7F:B0:8E:AA:91
BluetoothGatt: onClientConnectionState() - status=59 clientIf=5 device=C5:7F:B0:8E:AA:91
BluetoothGatt: close()
BluetoothGatt: unregisterApp() - mClientIf=5
我遇到了同样的问题。经过一番挖掘后,我发现在我们的案例中状态代码 59(或 0x3B 十六进制)指向 HCI_ERR_UNACCEPT_CONN_INTERVAL
。
通过检查我的 phone 的蓝牙 HCI 监听日志,我发现 ble 设备正在与 phone 协商连接参数。设备请求 7.5 毫秒的连接间隔,phone 拒绝了。三次(15 毫秒)后设备断开并重置。
我发现 this post 说 Android 6.0 中的最小连接间隔已更改为 12.5 毫秒。因此,如果您调整设备请求的连接间隔,您可能会保持连接。
我的 android 应用程序在中央连接到外围设备时运行,启用通知并且外围设备开始发送。
我的问题是连接在大约 13 秒后终止。
下面我有 logcat 信息。
Android 中蓝牙 LE 的状态 59 是什么?
BluetoothGatt: connect() - device: C5:7F:B0:8E:AA:91, auto: false
BluetoothGatt: registerApp()
BluetoothGatt: registerApp() - UUID=3a9c080d-ae20-47ea-b34c-7ea7798204cc
BluetoothGatt: onClientRegistered() - status=0 clientIf=5
BluetoothGatt: onClientConnectionState() - status=0 clientIf=5 device=C5:7F:B0:8E:AA:91
BluetoothGatt: discoverServices() - device: C5:7F:B0:8E:AA:91
BluetoothGatt: onSearchComplete() = Device=C5:7F:B0:8E:AA:91 Status=0
BluetoothGatt: setCharacteristicNotification() - uuid: 00002a05-0000-1000-8000-00805f9b34fb enable: true
BluetoothGatt: setCharacteristicNotification() - uuid: 00001625-1212-efde-1523-785feabcd123 enable: true
BluetoothGatt: cancelOpen() - device: C5:7F:B0:8E:AA:91
BluetoothGatt: onClientConnectionState() - status=59 clientIf=5 device=C5:7F:B0:8E:AA:91
BluetoothGatt: close()
BluetoothGatt: unregisterApp() - mClientIf=5
我遇到了同样的问题。经过一番挖掘后,我发现在我们的案例中状态代码 59(或 0x3B 十六进制)指向 HCI_ERR_UNACCEPT_CONN_INTERVAL
。
通过检查我的 phone 的蓝牙 HCI 监听日志,我发现 ble 设备正在与 phone 协商连接参数。设备请求 7.5 毫秒的连接间隔,phone 拒绝了。三次(15 毫秒)后设备断开并重置。
我发现 this post 说 Android 6.0 中的最小连接间隔已更改为 12.5 毫秒。因此,如果您调整设备请求的连接间隔,您可能会保持连接。