Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android]PlatformException(Characteristic unavailable, null, null, null) #143

Open
ankita-kanchan opened this issue Apr 25, 2023 · 6 comments

Comments

@ankita-kanchan
Copy link

ankita-kanchan commented Apr 25, 2023

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!

@GorIvanov
Copy link

GorIvanov commented Jun 8, 2023

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) => {}),
                    }),
          });

@SahilSharma2710
Copy link

@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

@ethmth
Copy link

ethmth commented Jun 20, 2023

Seconded on the example! I can't seem to get this to work on Android either.

@SahilSharma2710
Copy link

@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
Copy link

ethmth commented Jun 20, 2023

@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.

@SahilSharma2710
Copy link

@ethmthcan you update me once if u got any solution of ur problem , i am having same issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants