Skip to content

Commit 6c3aefa

Browse files
Olivier-ProGlovejhedberg
authored andcommitted
Bluetooth: host: Clear CCC when clearing all keys
CCC settings was not removed when unpairing all keys. It means CCC settings were still present in flash and were loading at bluetooth initialization time. Loading these orphan CCC settings would fill `bt_gatt_ccc_cfg` configurations and would prevent to add new CCC when pairing with a new device. Signed-off-by: Olivier Martin <[email protected]>
1 parent 23f1193 commit 6c3aefa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

subsys/bluetooth/host/keys.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "common/log.h"
2424

2525
#include "common/rpa.h"
26+
#include "gatt_internal.h"
2627
#include "hci_core.h"
2728
#include "smp.h"
2829
#include "settings.h"
@@ -229,6 +230,10 @@ static void keys_clear_id(struct bt_keys *keys, void *data)
229230
u8_t *id = data;
230231

231232
if (*id == keys->id) {
233+
if (IS_ENABLED(CONFIG_BT_SETTINGS)) {
234+
bt_gatt_clear_ccc(*id, &keys->addr);
235+
}
236+
232237
bt_keys_clear(keys);
233238
}
234239
}

0 commit comments

Comments
 (0)