Skip to content

Could not write to the right characteristic #524

Open
@NailAgliev

Description

@NailAgliev

I have two different services with different UUIDs that have characteristics with the same UUIDs.

  var chars1 = await peripheral.characteristics(SERVICE1);
  var chars2 = await peripheral.characteristics(SERVICE2);

  var char1 = chars1.firstWhere((element) => element.uuid == MY_CHAR);
  var char2 = chars2.firstWhere((element) => element.uuid == MY_CHAR);

Write to the first service characteristic everything works as expected.
Trying to write to second service characteristic results in data will be received in the first characteristic and most of the time data is corrupted.

  await char1.write(Uint8List.fromList([1]), false); //works as expected
  await char2.write(Uint8List.fromList([2]), false); //<-- data will go to char1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions