PhilipsHue / flutter_reactive_ble

Flutter library that handles BLE operations for multiple devices.
https://developers.meethue.com/
Other
662 stars 326 forks source link

CBATTErrorDomain:10, The attribute could not be found #813

Closed nguyenhuuta closed 10 months ago

nguyenhuuta commented 10 months ago

Describe the bug Unhandled Exception: PlatformException(CBATTErrorDomain:10, The attribute could not be found., {NSLocalizedDescription: The attribute could not be found.},

To Reproduce Steps to reproduce the behavior:

  1. scanForDevices -> OK
  2. connectToDevice -> OK
  3. discoverAllServices -> OK
  4. characteristic.subscribe -> error

Smartphone / tablet

Android still works fine, I see there is a difference between android and ios regarding UUID

IOS

Taym95 commented 10 months ago

Android publishes as Service UUID as long ID, iOS publishes as Service UUID as short ID, try this for example:

  static const _shortUuid = "ffff";
  static const _extendedUuid = "0000ffff-0000-9999-9999-0099999999";
  static final Uuid uuid = Platform.isAndroid ? Uuid.parse(_extendedUuid) : Uuid.parse(_shortUuid);
nguyenhuuta commented 10 months ago

Thanks you for reply, So what about the problem "characteristics.subscribe -> error"