From fd017fbf2bc1904dfe22d363d27b6e10ffd49aa4 Mon Sep 17 00:00:00 2001 From: Joe Finney Date: Mon, 25 Jan 2016 17:18:10 +0000 Subject: [PATCH] microbit: Update to indicate service change on SYS_ATTR_MISSING When using bonded connections to a central device, an explicit service changed indication should be used in cases where a device's GATT table appears out of date. This patch preserves the metadata of the Service Changed characterisitic, and also adds this indication as described. --- source/nRF5xGattServer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/nRF5xGattServer.cpp b/source/nRF5xGattServer.cpp index d1f9657..cb702c6 100644 --- a/source/nRF5xGattServer.cpp +++ b/source/nRF5xGattServer.cpp @@ -422,7 +422,8 @@ void nRF5xGattServer::hwCallback(ble_evt_t *p_ble_evt) } case BLE_GATTS_EVT_SYS_ATTR_MISSING: - sd_ble_gatts_sys_attr_set(gattsEventP->conn_handle, NULL, 0, 0); + sd_ble_gatts_sys_attr_set(gattsEventP->conn_handle, NULL, 0, BLE_GATTS_SYS_ATTR_FLAG_USR_SRVCS); + sd_ble_gatts_service_changed(gattsEventP->conn_handle, 0x000c, 0xffff); return; case BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST: