diff --git a/epicardium/ble/ble_main.c b/epicardium/ble/ble_main.c index c40d3df62c1ce290b7378475a61537e4d7df9e51..921976933d35b97f0e3394029d2cd4b5cd879088 100644 --- a/epicardium/ble/ble_main.c +++ b/epicardium/ble/ble_main.c @@ -22,6 +22,7 @@ #include "l2c_api.h" #include "dm_api.h" #include "att_api.h" +#include "gatt/gatt_api.h" #include "smp_api.h" #include "app_api.h" #include "app_db.h" @@ -956,6 +957,9 @@ void BleStart(void) ble_epic_ble_api_init(); + /* Set Service Changed CCCD index. */ + GattSetSvcChangedIdx(BLE_GATT_SC_CCC_IDX); + /* Reset the device */ DmDevReset(); } diff --git a/epicardium/ble/epic_att_api.c b/epicardium/ble/epic_att_api.c index 9dfa44dcde6e3b85ec36c9d635e9c272ee61f1bd..569ed5df484acc69ba39097712132855eea49a5f 100644 --- a/epicardium/ble/epic_att_api.c +++ b/epicardium/ble/epic_att_api.c @@ -7,6 +7,7 @@ #include "wsf_msg.h" #include "att_api.h" #include "wsf_buf.h" +#include "gatt/gatt_api.h" #include "FreeRTOS.h" #include "queue.h" @@ -212,9 +213,10 @@ int epic_ble_atts_dyn_add_descriptor( int epic_atts_dyn_send_service_changed_ind(void) { - // TODO: This is copied from an upstream stack version - // TODO: Handling of CCCDs in pairings is still broken - //GattSendServiceChangedInd(1, ATT_HANDLE_START, ATT_HANDLE_MAX); + /* Indicate to the server that our GATT DB changed. + * TODO: Handling of CCCDs in pairings might still be broken: + * See https://git.card10.badge.events.ccc.de/card10/firmware/-/issues/197 */ + GattSendServiceChangedInd(DM_CONN_ID_NONE, ATT_HANDLE_START, ATT_HANDLE_MAX); return 0; }