flutter_blue icon indicating copy to clipboard operation
flutter_blue copied to clipboard

Listeners triggered on two different services with same Characteristic UUID

Open fdugdale123 opened this issue 4 years ago • 6 comments

I am using a custom service to control a light. the service contains one characteristic for the light state, I have multiple lights and therefore am using multiple instances of services with the same service UUID and characteristic UUID. When I send data from the peripheral device through the state characteristic of one service it activates the listener on both services.

fdugdale123 avatar Aug 13 '20 14:08 fdugdale123

In these months I worked a lot on a scenario like yours. I choose to save the characteristic in a Map, for each device and I'm able to get different data from each device, without an effect like yours. I'm using notify-feature and listen to each stream on at least 4 different devices.

RedsAnDev avatar Aug 16 '20 19:08 RedsAnDev

In these months I worked a lot on a scenario like yours. I choose to save the characteristic in a Map, for each device and I'm able to get different data from each device, without an effect like yours. I'm using notify-feature and listen to each stream on at least 4 different devices.

I have not tried connecting on multiple devices so I do not know if this issue persists if I were to connect to multiple. my issue is that I have multiple services with a characteristic with the same UUID on the same device.

fdugdale123 avatar Aug 17 '20 07:08 fdugdale123

just tried your solution to save in a map and am still getting the same result. @pauldemarco any idea what causes this issue?

fdugdale123 avatar Aug 17 '20 09:08 fdugdale123

I have not tried connecting on multiple devices so I do not know if this issue persists if I were to connect to multiple. my issue is that I have multiple services with a characteristic with the same UUID on the same device.

Whoa, that's sound new for me. I google a few query and I found that is a common policy for many sensors. At this link https://stackoverflow.com/questions/27413272/what-gatt-services-use-multiple-characteristics-with-the-same-uuid you can find a docs about BLE standard.

RedsAnDev avatar Aug 17 '20 11:08 RedsAnDev

again, this is not my issue. the issue I am having is that I have multiple of the same service with the same characteristic. not one service with multiple characteristics with the same UUID.

my case:

  • Light Service Characteristic
  • Light Service Characteristic

the link:

  • Light Service Characteristic Characteristic

in my case when a value is changed on one characteristic the listener in both services is activated

fdugdale123 avatar Aug 17 '20 12:08 fdugdale123

I have this same problem. I have a device with two characteristics with the same UUID. Writing to either characteristic only writes to the first service.

Note that I have native code for both Android and iOS that works perfectly for this, so the device is not the problem. In my native code, writing to each characteristic writes to a separate service.

mgeilich avatar Feb 28 '23 16:02 mgeilich