Closed dusalex closed 1 year ago
same problem here
Same probleme here
Even within the same service, there may be multiple characteristic definitions with the same characteristic uuid. Spec:
A service may have multiple characteristic definitions with the same Characteristic UUID.
This is related to #478
Describe the bug When interacting with a BLE device that has the same characteristic UUIDs under different service UUIDs, the write characteristic commands do not ensure writing to the correct characteristic, even though the supplied parameter of type QualifiedCharacteristic contains the correct combination of service UUID and characteristic UUID.
Expected behavior Addressing a characteristic with a unique combination of characteristic UUID and service UUID should be possible.
Additional context https://github.com/PhilipsHue/flutter_reactive_ble/blob/master/packages/reactive_ble_mobile/android/src/main/kotlin/com/signify/hue/flutterreactiveble/ble/ReactiveBleClient.kt
For example, lines 176 - 186:
As the function only takes the charactistic UUID but not the service UUID, it cannot ensure writing to the correct characteristic in cases where the same characteristic UUID is present in multiple services. (The same holds for other functions in this file.)
On the other hand, the iOS implementation makes sure to respect the service: https://github.com/PhilipsHue/flutter_reactive_ble/blob/master/packages/reactive_ble_mobile/ios/Classes/ReactiveBle/Tasks/CharacteristicWrite/CharacteristicWriteTaskController.swift