OpenBluetoothToolbox / SimpleBLE

SimpleBLE - the all-in-one Bluetooth library for MacOS, iOS, Windows, Linux and Android.
https://www.simpleble.org
Other
675 stars 115 forks source link

How to the string value from the descriptor of a characteristic? #301

Open pole0815 opened 5 months ago

pole0815 commented 5 months ago

Hi, I am using windows 10, python 311 and simplepyble 0.7.3. I am would like to read descriptor strings of gatt characteristics.

I connect to a BLE device and scan for services and characteristics. For some characteristics I also get descriptor objects services[5].characteristics()[0].descriptors()

[<simplepyble._simplepyble.Descriptor at 0x19e557e7b70>, <simplepyble._simplepyble.Descriptor at 0x19e5354c270>]

But these descriptors only return a uuid and not the string value.

dir(services[5].characteristics()[0].descriptors()[0]) Out[11]: ['class', 'delattr', 'dir', 'doc', 'eq', 'format', 'ge', 'getattribute', 'getstate', 'gt', 'hash', 'init', 'init_subclass', 'le', 'lt', 'module', 'ne', 'new', 'reduce', 'reduce_ex', 'repr', 'setattr', 'sizeof', 'str', 'subclasshook', 'uuid']

How do I read the string value from the descriptor?