From dfe406b885aac98bf9a68958f29e20e15a337b19 Mon Sep 17 00:00:00 2001 From: Vincent Coubard Date: Tue, 9 Feb 2021 19:56:58 +0000 Subject: [PATCH] BLE: Add APIs to get characteristic authorization callbacks. --- .../include/ble/gatt/GattCharacteristic.h | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/connectivity/FEATURE_BLE/include/ble/gatt/GattCharacteristic.h b/connectivity/FEATURE_BLE/include/ble/gatt/GattCharacteristic.h index d5e88eedfb..cf310c3d4c 100644 --- a/connectivity/FEATURE_BLE/include/ble/gatt/GattCharacteristic.h +++ b/connectivity/FEATURE_BLE/include/ble/gatt/GattCharacteristic.h @@ -1579,6 +1579,17 @@ public: writeAuthorizationCallback.attach(object, member); } + /** + * Return the callback registered to handle client's write. + * + * @return the callback that handles client's write requests. + */ + const FunctionPointerWithContext& + getWriteAuthorizationCallback() const + { + return writeAuthorizationCallback; + } + /** * Register the read requests event handler. * @@ -1616,6 +1627,17 @@ public: readAuthorizationCallback.attach(object, member); } + /** + * Return the callback registered to handle client's read. + * + * @return the callback that handles client's read requests. + */ + const FunctionPointerWithContext& + getReadAuthorizationCallback() const + { + return readAuthorizationCallback; + } + /** * Invoke the write authorization callback. *