Bluetooth: Always restart advertising on disconnect event
Restart advertising on LE disconnect event even if related connection object was not found. Change-Id: Ia18831ef4f84edb25bf1443793ebb194971ba1dd Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This commit is contained in:
parent
0dc25e3849
commit
4245fc4dc7
1 changed files with 2 additions and 1 deletions
|
@ -530,7 +530,7 @@ static void hci_disconn_complete(struct net_buf *buf)
|
||||||
conn = bt_conn_lookup_handle(handle);
|
conn = bt_conn_lookup_handle(handle);
|
||||||
if (!conn) {
|
if (!conn) {
|
||||||
BT_ERR("Unable to look up conn with handle %u", handle);
|
BT_ERR("Unable to look up conn with handle %u", handle);
|
||||||
return;
|
goto advertise;
|
||||||
}
|
}
|
||||||
|
|
||||||
conn->err = evt->reason;
|
conn->err = evt->reason;
|
||||||
|
@ -566,6 +566,7 @@ static void hci_disconn_complete(struct net_buf *buf)
|
||||||
|
|
||||||
bt_conn_unref(conn);
|
bt_conn_unref(conn);
|
||||||
|
|
||||||
|
advertise:
|
||||||
if (atomic_test_bit(bt_dev.flags, BT_DEV_KEEP_ADVERTISING)) {
|
if (atomic_test_bit(bt_dev.flags, BT_DEV_KEEP_ADVERTISING)) {
|
||||||
set_advertise_enable();
|
set_advertise_enable();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue