Android GATT 137读取特性时的例外情况
我正在使用RxAndroidBle库连接BlueToToToOth设备。当我读到蓝牙设备的特性时,我得到了GATT137异常。 为什么我看不懂? 代码段:Android GATT 137读取特性时的例外情况,android,bluetooth,bluetooth-lowenergy,rxandroidble,Android,Bluetooth,Bluetooth Lowenergy,Rxandroidble,我正在使用RxAndroidBle库连接BlueToToToOth设备。当我读到蓝牙设备的特性时,我得到了GATT137异常。 为什么我看不懂? 代码段: if (device.connectionState == RxBleConnection.RxBleConnectionState.CONNECTED) { rxConnection.readCharacteristic(ConstantsBle.deviceUUIDCharacteristic).subscribe({
if (device.connectionState == RxBleConnection.RxBleConnectionState.CONNECTED) {
rxConnection.readCharacteristic(ConstantsBle.deviceUUIDCharacteristic).subscribe({
Log.e(TAG, "read characteristic task is success")
}, {
it.printStackTrace()
})
}
例外情况详情:
W/System.err:
com.polidea.rxandroidble.exceptions.BleGattCharacteristicException:
来自MAC地址0C:F3:EE:2A:ED:49的GATT例外,状态137,类型
blegatoperation{description='CHARACTERISTIC\u READ'}。(查找状态)
这里是0x89
)
W/System.err:at
com.polidea.rxandroidble.internal.connection.rxblegatetcallback.propagateErrorIfOccurrend(rxblegatetcallback.java:227)
W/System.err:at
com.polidea.rxandroidble.internal.connection.rxblegatetcallback.access$800(rxblegatetcallback.java:32)
W/System.err:at
com.polidea.rxandroidble.internal.connection.rxblettcallback$2.onCharacteristicRead(rxblettcallback.java:108)
位于android.bluetooth.BluetoothGatt$1.onCharacteristicRead(BluetoothGatt.java:286)
W/System.err:at
android.bluetooth.iblueThoothGattCallback$Stub.onTransact(iblueThoothGattCallback.java:117)
W/System.err:at-android.os.Binder.execTransact(Binder.java:565)
无法读取特征,因为与外围设备的身份验证失败 状态代码:
137
(0x89
hex)如中所述。你甚至在你粘贴的日志中有链接
这种情况可能有以下几个原因:
配对是一个短期过程,适用于特定的连接,而绑定是与加密密钥的后续交换配对(这些密钥可以在下次配对时重新使用)。问题是什么?@Dariuszweweryn抱歉,我编辑了这个问题。有什么新闻吗?你有没有检查过任何可能的答案?对不起,我会检查你的答案然后回来。我希望有人能写一篇关于结对与结合的正式论文。然后我希望每个人都能坚持下去!甚至谷歌有时也会在官方Android文档中互换使用这些术语。