Skip to content

Commit

Permalink
Fix advertisement restart.
Browse files Browse the repository at this point in the history
  • Loading branch information
kareltucek committed Dec 30, 2024
1 parent c3f2bbe commit 808a90c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions device/src/bt_advertise.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}

Expand Down
4 changes: 4 additions & 0 deletions device/src/bt_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 808a90c

Please sign in to comment.