From ec373c29a07e147d59353921cf6c1c6e09602496 Mon Sep 17 00:00:00 2001 From: paul-szczepanek-arm <33840200+paul-szczepanek-arm@users.noreply.github.com> Date: Tue, 4 Sep 2018 13:30:08 +0100 Subject: [PATCH 1/2] missing onDataSent calblack for cordio --- .../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 41568ab5f3..2ed03c6fff 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioGattServer.cpp +++ b/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioGattServer.cpp @@ -624,6 +624,8 @@ ble_error_t GattServer::write( // successful uint16_t conn_id = 0; uint16_t conn_found = 0; + size_t updates_sent = 0; + while((conn_found < DM_CONN_MAX) && (conn_id < CONNECTION_ID_LIMIT)) { if (DmConnInUse(conn_id) == true) { ++conn_found; @@ -631,15 +633,21 @@ ble_error_t GattServer::write( uint16_t cccd_config = AttsCccEnabled(conn_id, cccd_index); if (cccd_config & ATT_CLIENT_CFG_NOTIFY) { AttsHandleValueNtf(conn_id, att_handle, len, (uint8_t*)buffer); + updates_sent++; } if (cccd_config & ATT_CLIENT_CFG_INDICATE) { AttsHandleValueInd(conn_id, att_handle, len, (uint8_t*)buffer); + updates_sent++; } } } ++conn_id; } + if (updates_sent) { + handleDataSentEvent(updates_sent); + } + return BLE_ERROR_NONE; } From 44d3504dbb156cbaf2747edef297f3b8965c77f2 Mon Sep 17 00:00:00 2001 From: paul-szczepanek-arm <33840200+paul-szczepanek-arm@users.noreply.github.com> Date: Tue, 4 Sep 2018 13:58:50 +0100 Subject: [PATCH 2/2] missing overload --- .../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 2ed03c6fff..af13e72db3 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioGattServer.cpp +++ b/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioGattServer.cpp @@ -682,16 +682,24 @@ ble_error_t GattServer::write( } // This characteristic has a CCCD attribute. Handle notifications and indications. + size_t updates_sent = 0; + if (is_update_authorized(connection, att_handle)) { uint16_t cccEnabled = AttsCccEnabled(connection, cccd_index); if (cccEnabled & ATT_CLIENT_CFG_NOTIFY) { AttsHandleValueNtf(connection, att_handle, len, (uint8_t*)buffer); + updates_sent++; } if (cccEnabled & ATT_CLIENT_CFG_INDICATE) { AttsHandleValueInd(connection, att_handle, len, (uint8_t*)buffer); + updates_sent++; } } + if (updates_sent) { + handleDataSentEvent(updates_sent); + } + return BLE_ERROR_NONE; }