missing onDataSent calblack for cordio

pull/7981/head
paul-szczepanek-arm 2018-09-04 13:30:08 +01:00
parent 44925d8527
commit ec373c29a0
1 changed files with 8 additions and 0 deletions

View File

@ -624,6 +624,8 @@ ble_error_t GattServer::write(
// successful // successful
uint16_t conn_id = 0; uint16_t conn_id = 0;
uint16_t conn_found = 0; uint16_t conn_found = 0;
size_t updates_sent = 0;
while((conn_found < DM_CONN_MAX) && (conn_id < CONNECTION_ID_LIMIT)) { while((conn_found < DM_CONN_MAX) && (conn_id < CONNECTION_ID_LIMIT)) {
if (DmConnInUse(conn_id) == true) { if (DmConnInUse(conn_id) == true) {
++conn_found; ++conn_found;
@ -631,15 +633,21 @@ ble_error_t GattServer::write(
uint16_t cccd_config = AttsCccEnabled(conn_id, cccd_index); uint16_t cccd_config = AttsCccEnabled(conn_id, cccd_index);
if (cccd_config & ATT_CLIENT_CFG_NOTIFY) { if (cccd_config & ATT_CLIENT_CFG_NOTIFY) {
AttsHandleValueNtf(conn_id, att_handle, len, (uint8_t*)buffer); AttsHandleValueNtf(conn_id, att_handle, len, (uint8_t*)buffer);
updates_sent++;
} }
if (cccd_config & ATT_CLIENT_CFG_INDICATE) { if (cccd_config & ATT_CLIENT_CFG_INDICATE) {
AttsHandleValueInd(conn_id, att_handle, len, (uint8_t*)buffer); AttsHandleValueInd(conn_id, att_handle, len, (uint8_t*)buffer);
updates_sent++;
} }
} }
} }
++conn_id; ++conn_id;
} }
if (updates_sent) {
handleDataSentEvent(updates_sent);
}
return BLE_ERROR_NONE; return BLE_ERROR_NONE;
} }