bleak.exc.BleakError: Multiple Characteristics with this UUID, refer to your desired characteristic by the handle
attribute instead.
#659
-
DescriptionI got the below error when trying to write 0x02 to a characteristic:
What I Did
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
Did you try what the error message suggests?
|
Beta Was this translation helpful? Give feedback.
-
How do I get the handle attribute? |
Beta Was this translation helpful? Give feedback.
-
First, get the |
Beta Was this translation helpful? Give feedback.
-
How do I do that? |
Beta Was this translation helpful? Give feedback.
-
Maybe something like this? async with BleakClient(device) as client:
my_service, = (s for s in client.get_services() if s.uuid == MY_SERVICE_UUID)
my_char = my service.get_characteristic(MY_CHAR_UUID)
client.write_gatt_char(my_char, MY_VALUE)
... |
Beta Was this translation helpful? Give feedback.
Maybe something like this?