Skip to content

Commit a4560bf

Browse files
committed
bluetooth: host: hci_core: allow both orders of version and feature events
Previously, the version complete event had to come after the remote feature complete event for the notify_remote_info function to be called. This becomes less practical when adding the read all remote features complete event, as this can take some time. Meaning the order of events is not predictable.
1 parent e3ed029 commit a4560bf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

subsys/bluetooth/host/hci_core.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1792,7 +1792,8 @@ static void le_remote_feat_complete(struct net_buf *buf)
17921792
atomic_set_bit(conn->flags, BT_CONN_LE_FEATURES_EXCHANGED);
17931793

17941794
if (IS_ENABLED(CONFIG_BT_REMOTE_INFO) &&
1795-
!IS_ENABLED(CONFIG_BT_REMOTE_VERSION)) {
1795+
(!IS_ENABLED(CONFIG_BT_REMOTE_VERSION) ||
1796+
atomic_test_bit(conn->flags, BT_CONN_AUTO_VERSION_INFO))) {
17961797
notify_remote_info(conn);
17971798
}
17981799

@@ -2372,7 +2373,8 @@ static void bt_hci_evt_read_remote_version_complete(struct net_buf *buf)
23722373

23732374
atomic_set_bit(conn->flags, BT_CONN_AUTO_VERSION_INFO);
23742375

2375-
if (IS_ENABLED(CONFIG_BT_REMOTE_INFO)) {
2376+
if (IS_ENABLED(CONFIG_BT_REMOTE_INFO) &&
2377+
!atomic_test_bit(conn->flags, BT_CONN_LE_FEATURES_EXCHANGED)) {
23762378
/* Remote features is already present */
23772379
notify_remote_info(conn);
23782380
}

0 commit comments

Comments
 (0)