Closed StephenDone closed 1 month ago
read_gatt_char(0x2A29): Characteristic with UUID 10793 could not be found!
This is expected since int
values are treated as a "handle" rather than a UUID.
The "correct" way to do this would be read_gatt_char(normalize_uuid_16(0x2A29))
which converts it to the full UUID string.
read_gatt_char('2A29'): Characteristic with UUID 2A29 could not be found! read_gatt_char('2a29'): Characteristic with UUID 2a29 could not be found!
This looks like it could potentially be a bug/inconsistency in the APIs. Workaround could be to use the normalize_uuid_16()
variant mentioned above.
Ok, no problem. And thanks for writing and sharing this excellent ble client.
May I suggest updating the usage example code, so that it works though. It may discourage some people if they can’t get the example to work. Maybe add the function you suggest, or use the full guid.
bluetoothctl -v
) in case of Linux: bluetoothctl: 5.66Description
After installing bleak, I tried the basic 'USAGE' sample from here: https://github.com/hbldh/bleak ...which reads the model number characteristic. Since my device does not have this characteristic, I changed to the Manufacturer Name UUID - "2A29", instead of "2A24". With no other changes, the sample fails with error 'Characteristic with UUID 2A29 could not be found.
What I Did
I experimented with using the characteristic, the characteristic handle, short integer uuid, short string uuid and full uuid. The characteristic, characteristic handle and full uuid all returned the manufacturer name. Both short uuids tests did not.
Test Program
Test Output