diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2021-08-18 13:45:05 -0700 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2021-08-19 11:32:28 -0700 |
commit | 3c0a4dfdb6634f734541e28f00ab26312afa495b (patch) | |
tree | 57c999606f034ad2f9c9928c4d3ade40a41b365c /emulator | |
parent | a0f67f43331494081550a1d2a0f30b254b54a3e8 (diff) | |
download | bluez-3c0a4dfdb6634f734541e28f00ab26312afa495b.tar.gz |
btdev: Fix order of BT_HCI_EVT_LE_ADV_SET_TERM
BT_HCI_EVT_LE_ADV_SET_TERM shall come after
BT_HCI_EVT_LE_ENHANCED_CONN_COMPLETE otherwise the host doesn't know
the connection handle.
Diffstat (limited to 'emulator')
-rw-r--r-- | emulator/btdev.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/emulator/btdev.c b/emulator/btdev.c index 30a7abf07..4584b0ecf 100644 --- a/emulator/btdev.c +++ b/emulator/btdev.c @@ -5104,22 +5104,17 @@ static void le_ext_conn_complete(struct btdev *btdev, struct le_ext_adv *ext_adv, uint8_t status) { + struct btdev_conn *conn = NULL; struct bt_hci_evt_le_enhanced_conn_complete ev; struct bt_hci_le_ext_create_conn *lecc = (void *)cmd->data; memset(&ev, 0, sizeof(ev)); if (!status) { - struct btdev_conn *conn; - conn = conn_add_acl(btdev, cmd->peer_addr, cmd->peer_addr_type); if (!conn) return; - /* Disable EXT ADV */ - queue_foreach(btdev->le_ext_adv, ext_adv_term, conn); - queue_foreach(conn->link->dev->le_ext_adv, ext_adv_term, conn); - ev.status = status; ev.peer_addr_type = btdev->le_scan_own_addr_type; if (ev.peer_addr_type == 0x01) @@ -5136,6 +5131,9 @@ static void le_ext_conn_complete(struct btdev *btdev, le_meta_event(conn->link->dev, BT_HCI_EVT_LE_ENHANCED_CONN_COMPLETE, &ev, sizeof(ev)); + + /* Disable EXT ADV */ + queue_foreach(conn->link->dev->le_ext_adv, ext_adv_term, conn); } ev.status = status; @@ -5150,6 +5148,10 @@ static void le_ext_conn_complete(struct btdev *btdev, le_meta_event(btdev, BT_HCI_EVT_LE_ENHANCED_CONN_COMPLETE, &ev, sizeof(ev)); + + /* Disable EXT ADV */ + if (conn) + queue_foreach(btdev->le_ext_adv, ext_adv_term, conn); } static int cmd_ext_create_conn_complete(struct btdev *dev, const void *data, |