diff --git a/device/src/bt_pair.c b/device/src/bt_pair.c index b2ed3143..46423276 100644 --- a/device/src/bt_pair.c +++ b/device/src/bt_pair.c @@ -210,12 +210,16 @@ bool BtPair_IsDeviceBonded(const bt_addr_le_t *addr) void deleteBondIfUnknown(const struct bt_bond_info *info, void *user_data) { if (!HostConnections_IsKnownBleAddress(&info->addr)) { + printk(" - Deleting an unknown bond!\n"); deleteBond(info); + } else { + printk(" - Keeping a known bond.\n"); } }; void BtPair_ClearUnknownBonds() { + printk("Clearing bonds\n"); bt_foreach_bond(BT_ID_DEFAULT, deleteBondIfUnknown, NULL); UsbCommand_UpdateNewPairingsFlag(); } diff --git a/device/src/main.c b/device/src/main.c index 08e31897..7c4ef95a 100644 --- a/device/src/main.c +++ b/device/src/main.c @@ -129,6 +129,11 @@ int main(void) { Ledmap_InitLedLayout(); } + bt_enable(NULL); + + // has to be after bt_enable, has to be before ApplyConfig + InitSettings(); + // read configurations { InitFlash(); @@ -155,11 +160,6 @@ int main(void) { USB_EnableHid(); // has to be after USB_SetSerialNumber - bt_enable(NULL); - - // has to be after bt_enable - InitSettings(); - // has to be after InitSettings BtManager_InitBt(); BtManager_StartBt();