Navideck / universal_ble

A cross-platform Android/iOS/macOS/Windows/Linux/Web Bluetooth Low Energy (BLE) plugin for Flutter
https://pub.dev/packages/universal_ble
Other
19 stars 2 forks source link

Only receive notifications from the first characteristic registered (Android only) #36

Open leemind opened 4 weeks ago

leemind commented 4 weeks ago

I have an ESP32 device which notifies on 2 different characteristics. I register both characteristics to notify

UniversalBle.setNotifiable(devices[deviceID]!.device!.deviceId, Uuids.mainService, Uuids.firmwareControlCharStr, BleInputProperty.notification); UniversalBle.setNotifiable(devices[deviceID]!.device!.deviceId, Uuids.mainService, Uuids.dataCharStr, BleInputProperty.notification);

and in the debug Gatt messages this appears to be ok:

D/BluetoothGatt(24436): setCharacteristicNotification() - uuid: f645686e-cee8-418b-971a-366c641544bc enable: true D/BluetoothGatt(24436): setCharacteristicNotification() - uuid: 66ca5b73-7c39-4a6b-8915-ca0621b31803 enable: true

However in my UniversalBle.onValueChanged I only ever receive notifications for the first registered characteristic. I have swapped the two lines around in the code and verified this.

On iOS it works perfectly as expected

Flutter Doctor:


[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.2)
[✓] VS Code (version 1.88.1)
[✓] Connected device (4 available)
[✓] Network resources```
rohitsangwan01 commented 2 weeks ago

@leemind i tried multiple android characteristic together in android, and getting events from all properly can you try with another app like NrfConnect to cross check