diff options
author | Pete Johanson <peter@peterjohanson.com> | 2020-09-03 13:21:01 -0400 |
---|---|---|
committer | Pete Johanson <peter@peterjohanson.com> | 2020-09-13 22:33:05 -0400 |
commit | 13842a8a1e45b399864ba1ae5a759c614313b4db (patch) | |
tree | 552b02f82c6b9172c7d83f85db93c4a3d0723442 /app | |
parent | fc0812bd2eb08d66819f38bafd1f5d00b933c87b (diff) |
fix(bluetooth): Kconfig to clear bonds on start
Diffstat (limited to 'app')
-rw-r--r-- | app/Kconfig | 4 | ||||
-rw-r--r-- | app/src/ble.c | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/app/Kconfig b/app/Kconfig index 11a3cc0..b9d05a9 100644 --- a/app/Kconfig +++ b/app/Kconfig @@ -52,6 +52,10 @@ config ZMK_BLE_INIT_PRIORITY config SYSTEM_WORKQUEUE_STACK_SIZE default 2048 +config ZMK_BLE_CLEAR_BONDS_ON_START + bool "Configuration that clears all bond information from the keyboard on startup." + default n + # HID GATT notifications sent this way are *not* picked up by Linux, and possibly others. config BT_GATT_NOTIFY_MULTIPLE default n diff --git a/app/src/ble.c b/app/src/ble.c index 0aba16c..1e748ed 100644 --- a/app/src/ble.c +++ b/app/src/ble.c @@ -346,6 +346,12 @@ static int zmk_ble_init(struct device *_arg) #endif +#if IS_ENABLED(CONFIG_ZMK_BLE_CLEAR_BONDS_ON_START) + for (int i = 0; i < 10; i++) { + bt_unpair(i, NULL); + } +#endif + bt_conn_cb_register(&conn_callbacks); bt_conn_auth_cb_register(&zmk_ble_auth_cb_display); |