fix: put back API: characteristic.read\_descriptor(uuid)

This commit is contained in:
jirikrepl
2019-10-18 18:05:58 +02:00
parent c6112269bb
commit 2f458d4114

View File

@@ -48,3 +48,25 @@ This method allows to register for notifications on the characteristic.
* `handler` is the function that will be executed when the callback is triggered.
* `arg` is the argument that gets passed to the callback. If nothing is given, the characteristic object that owns the callback will be used.
#### characteristic.read\_descriptor(uuid)
Returns the value of the descriptor specified by the `uuid` parameter. If no descriptor found for the characteristic returns None.
```python
descriptor = char.read_descriptor(0x2900)
if(descriptor != None):
print("Characteristic Extended Properties: " + str(binascii.hexlify((descriptor))))
descriptor = char.read_descriptor(0x2901)
if(descriptor != None):
print("Characteristic User Description: " + str(binascii.hexlify((descriptor))))
descriptor = char.read_descriptor(0x2902)
if(descriptor != None):
print("Client Characteristic Configuration: " + str(binascii.hexlify((descriptor))))
descriptor = char.read_descriptor(0x2904)
if(descriptor != None):
print("Characteristic Presentation Format: " + str(binascii.hexlify((descriptor))))
```