0

我在连接到基于 pca10040 的板时在 Android BLE 应用程序上收到上述错误,我使用 nRF Toolbox 作为参考开发了这个应用程序。

我正在多个 Android 版本和设备上对此进行测试,其中我在 motorolla devic 或 nexus 设备(android 7)或带有 android 6 的一加一上没有任何问题。

我在使用 android 6.0.1 的 redmi 3s prime 上特别面临这个问题。在此设备上,我的连接处理程序将等待一段时间,然后抛出此错误。

我附上了测试不同设备的日志:

    **Note : 1 = Connected state
         2 = Connecting state

Mi Redme 3s Prime (6.0.1 - Marshmallow)
Result: Fail

04-18 11:56:59.462 8852-8852/com.demo.bledoorlock D/BluetoothGatt: connect() - device: D0:35:52:F8:A9:59, auto: false
04-18 11:56:59.462 8852-8852/com.demo.bledoorlock D/BluetoothGatt: registerApp()
04-18 11:56:59.462 8852-8852/com.demo.bledoorlock D/BluetoothGatt: registerApp() - UUID=dd2097ce-ff94-42e4-a454-4c4401aa5482
04-18 11:56:59.466 8852-8892/com.demo.bledoorlock D/BluetoothGatt: onClientRegistered() - status=0 clientIf=5
04-18 11:56:59.467 8852-8852/com.demo.bledoorlock I/System.out: 2
04-18 11:57:00.740 8852-8888/com.demo.bledoorlock V/FA: Inactivity, disconnecting from the service
04-18 11:57:29.490 8852-8992/com.demo.bledoorlock D/BluetoothGatt: onClientConnectionState() - status=133 clientIf=5 device=D0:35:52:F8:A9:59
04-18 11:57:29.491 8852-8852/com.demo.bledoorlock I/System.out: 2


Mi Redme 2 Prime (5.1.1 - Lollipop)
Result: Pass

04-18 11:54:13.871 25251-25251/com.demo.bledoorlock D/BluetoothGatt: connect() - device: D0:35:52:F8:A9:59, auto: false
04-18 11:54:13.871 25251-25251/com.demo.bledoorlock D/BluetoothGatt: registerApp()
04-18 11:54:13.871 25251-25251/com.demo.bledoorlock D/BluetoothGatt: registerApp() - UUID=cb431bbb-bc5e-459b-bdcf-f7ed1929fa01
04-18 11:54:13.871 25251-25580/com.demo.bledoorlock D/BluetoothGatt: onClientRegistered() - status=0 clientIf=5
04-18 11:54:13.871 25251-25251/com.demo.bledoorlock I/System.out: 2
04-18 11:54:14.071 25251-25267/com.demo.bledoorlock D/BluetoothGatt: onClientConnectionState() - status=0 clientIf=5 device=D0:35:52:F8:A9:59
04-18 11:54:14.071 25251-25251/com.demo.bledoorlock I/System.out: 1
04-18 11:54:14.091 25251-25251/com.demo.bledoorlock D/BluetoothGatt: discoverServices() - device: D0:35:52:F8:A9:59
04-18 11:54:14.091 25251-25251/com.demo.bledoorlock I/ViewRootImpl: CPU Rendering VSync enable = true
04-18 11:54:14.091 25251-25580/com.demo.bledoorlock D/BluetoothGatt: onSearchComplete() = Device=D0:35:52:F8:A9:59 Status=0
04-18 11:54:14.101 25251-25580/com.demo.bledoorlock D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e400003-b5a3-f393-e0a9-e50e24dcca9e enable: true


Oneplus One (6.0.1 - Marshmallow)
Result: Pass

04-18 11:58:16.768 28661-28661/com.demo.bledoorlock D/BluetoothGatt: connect() - device: D0:35:52:F8:A9:59, auto: false
04-18 11:58:16.768 28661-28661/com.demo.bledoorlock D/BluetoothGatt: registerApp()
04-18 11:58:16.768 28661-28661/com.demo.bledoorlock D/BluetoothGatt: registerApp() - UUID=a3af82f0-c095-4b06-a1fb-479d7d5f715e
04-18 11:58:16.770 28661-28674/com.demo.bledoorlock D/BluetoothGatt: onClientRegistered() - status=0 clientIf=5
04-18 11:58:16.777 28661-28661/com.demo.bledoorlock I/System.out: 2
04-18 11:58:17.073 28661-28675/com.demo.bledoorlock D/BluetoothGatt: onClientConnectionState() - status=0 clientIf=5 device=D0:35:52:F8:A9:59
04-18 11:58:17.074 28661-28661/com.demo.bledoorlock I/System.out: 1
04-18 11:58:17.086 28661-28661/com.demo.bledoorlock D/BluetoothGatt: discoverServices() - device: D0:35:52:F8:A9:59
04-18 11:58:17.089 28661-28674/com.demo.bledoorlock D/BluetoothGatt: onSearchComplete() = Device=D0:35:52:F8:A9:59 Status=0
04-18 11:58:17.092 28661-28674/com.demo.bledoorlock D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e400003-b5a3-f393-e0a9-e50e24dcca9e enable: true
04-18 11:58:17.159 28661-28697/com.demo.bledoorlock V/RenderScript: 0xaeee3000 Launching thread(s), CPUs 4
04-18 11:58:17.571 28661-28693/com.demo.bledoorlock V/FA: Inactivity, disconnecting from the service

请建议如何解决这个问题?

4

0 回答 0