From 070a412432d736cfaca2b32153c11b366f10a2bb Mon Sep 17 00:00:00 2001 From: Desmond Chen Date: Mon, 4 Mar 2019 11:08:15 +0800 Subject: [PATCH] BLE:Cordio:insert_descriptor check r/w properties --- .../targets/TARGET_CORDIO/source/CordioGattServer.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioGattServer.cpp b/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioGattServer.cpp index 0b4bb8a82d..89f46fbfe4 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioGattServer.cpp +++ b/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioGattServer.cpp @@ -488,6 +488,10 @@ ble_error_t GattServer::insert_descriptor( #endif // BLE_FEATURE_SECURE_CONNECTIONS #endif // BLE_FEATURE_SECURITY } + + if (properties & READ_PROPERTY) { + attribute_it->settings |= ATTS_SET_READ_CBACK; + } } // configure write permission @@ -517,6 +521,10 @@ ble_error_t GattServer::insert_descriptor( #endif // BLE_FEATURE_SECURE_CONNECTIONS #endif // BLE_FEATURE_SECURITY } + + if (properties & WRITABLE_PROPERTIES) { + attribute_it->settings |= ATTS_SET_WRITE_CBACK; + } } attribute_it++;