[Android]PlatformException(Characteristic unavailable, null, null, null)
quick blue irregularly throws this PlatformException(Characteristic unavailable, null, null, null)
E/flutter (21750): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(Characteristic unavailable, null, null, null)
E/flutter (21750): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:653)
E/flutter (21750): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:296)
E/flutter (21750):
Does anyone have an idea how I can fix/avoid the exception?
Thanks!
I have found solution when debuging. First we should write descyptor.
QuickBlue.writeValue(
selectedDeviceAddress!.address!,
uuidEEG,
uuidEEGCtrl,
Uint8List.fromList([0x01, 0x01]),
BleOutputProperty.withResponse,
).
Next we call setNotifiable but there should be a timeout... I took 1 sec. So this works for me:
QuickBlue.writeValue(
selectedDeviceAddress!.address!,
uuid1,
uuid2,
Uint8List.fromList([0x01, 0x01]),
BleOutputProperty.withResponse,
).then((value) => {
Timer(
Duration(milliseconds: 1000),
() => {
QuickBlue.setNotifiable(
selectedDeviceAddress!.address!,
uuid1,
uuid3,
BleInputProperty.notification,
).then((value) => {}),
}),
});
@ankita-kanchan hey , Ankita can u provide a running example for this package in android . It's urgent. I am unable to run this package on android
Seconded on the example! I can't seem to get this to work on Android either.
@ethmth i am able to run this package on android now This following repo was helpful https://github.com/MatheusJulidori/dart-flutter/tree/main/bluetooth_app
@ethmth i am able to run this package on android now This following repo was helpful https://github.com/MatheusJulidori/dart-flutter/tree/main/bluetooth_app
Thank you. Unfortunately that example doesn't seem to include readValue/writeValue/setNotifiable, which is where I'm having trouble.
@ethmthcan you update me once if u got any solution of ur problem , i am having same issues.