Open Matrix-Zhang opened 4 years ago
Error code 2 means operation cancelled. I think you might've passed the same transaction ID to two operations.
Error code 2 means operation cancelled. I think you might've passed the same transaction ID to two operations.
Okay, i think the transaction id is session id....
after i remove the transaction id, new error comes
E/flutter (24967): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: BleError (Error code: 3, ATT error code: null, iOS error code: null, Android error code: null, reason: GATT exception from MAC address 5B:14:86:24:98:64, with type BleGattOperation{description='CHARACTERISTIC_READ'}, internal message: null, device ID: null, service UUID: null, characteristic UUID: null, descriptor UUID: null)
3 is operation timeout. https://github.com/Polidea/FlutterBleLib/blob/develop/lib/error/ble_error.dart
This library is based on our React Native BLE library and some things are directly translated from there. You can check out what the errors mean here: https://polidea.github.io/react-native-ble-plx/#bleerrorcode
I need to add docs to those error codes here...
3 is operation timeout. https://github.com/Polidea/FlutterBleLib/blob/develop/lib/error/ble_error.dart
This library is based on our React Native BLE library and some things are directly translated from there. You can check out what the errors mean here: https://polidea.github.io/react-native-ble-plx/#bleerrorcode
I need to add docs to those error codes here...
why timeout? if i remove the Characteristic's read method, just listen on Characteristic's monitor, the data will received....
I don't why, I haven't seen your code. 🙂 If you're not monitoring, does the read succeed?
I don't why, I haven't seen your code. 🙂 If you're not monitoring, does the read succeed?
if i not monitoring, the read timeout,
the code just like:
write("1234") ; //send to peripheral success, peripheral will received the data
read(); // read from peripheral timeout, if change to monitor, data coming
if android read from ios, the error code is 402
session error: BleError (Error code: 402, ATT error code: null, iOS error code: null, Android error code: 241, reason: GATT exception from MAC address 7B:B1:06:39:0D:F1, status 241 (UNKNOWN), type BleGattOperation{description='CHARACTERISTIC_READ'}. (Look up status 0xf1 here https://android.googlesource.com/platform/external/bluetooth/bluedroid/+/android-5.1
Can you check the permissions on your characteristic? (isReadable
, isWritable
, etc.)
Can you check the permissions on your characteristic? (
isReadable
,isWritable
, etc.)
yes, i have checked it already, the characteristic is readable
use the monitor is ok