diff --git a/device/src/bt_advertise.c b/device/src/bt_advertise.c index 2424025a..93c99ba7 100644 --- a/device/src/bt_advertise.c +++ b/device/src/bt_advertise.c @@ -84,8 +84,8 @@ void BtAdvertise_Start(uint8_t adv_type) printk("%s advertising continued\n", adv_type_string); } else { printk("%s advertising failed to start (err %d)\n", adv_type_string, err); - BtConn_ListCurrentConnections(); - EventScheduler_Schedule(CurrentTime + 1000, EventSchedulerEvent_BtStartAdvertisement, "BtStartAdvertisement"); + BtConn_DisconnectAll(); + EventScheduler_Schedule(CurrentTime + 50, EventSchedulerEvent_BtStartAdvertisement, "BtStartAdvertisement"); } } diff --git a/device/src/bt_conn.c b/device/src/bt_conn.c index 0bf3aa2d..cb8acc81 100644 --- a/device/src/bt_conn.c +++ b/device/src/bt_conn.c @@ -388,6 +388,10 @@ static void auth_passkey_display(struct bt_conn *conn, unsigned int passkey) } static void auth_passkey_confirm(struct bt_conn *conn, unsigned int passkey) { + if (auth_conn) { + bt_conn_unref(auth_conn); + } + auth_conn = bt_conn_ref(conn); printk("Received passkey pairing inquiry.\n");