From 2f458d41149f8802630233631aead2f04b97bb26 Mon Sep 17 00:00:00 2001 From: jirikrepl Date: Fri, 18 Oct 2019 18:05:58 +0200 Subject: [PATCH] fix: put back API: characteristic.read\_descriptor(uuid) --- .../network/bluetooth/gattccharacteristic.md | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/content/firmwareapi/pycom/network/bluetooth/gattccharacteristic.md b/content/firmwareapi/pycom/network/bluetooth/gattccharacteristic.md index 9eef49c..6a60c47 100644 --- a/content/firmwareapi/pycom/network/bluetooth/gattccharacteristic.md +++ b/content/firmwareapi/pycom/network/bluetooth/gattccharacteristic.md @@ -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)))) +``` +