diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index e11375b196c..3ffbc2c38cc 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -2812,7 +2812,7 @@ int bt_conn_get_info(const struct bt_conn *conn, struct bt_conn_info *info) int bt_conn_get_remote_info(struct bt_conn *conn, struct bt_conn_remote_info *remote_info) { - if (!atomic_test_bit(conn->flags, BT_CONN_AUTO_FEATURE_EXCH) || + if (!atomic_test_bit(conn->flags, BT_CONN_LE_FEATURES_EXCHANGED) || (IS_ENABLED(CONFIG_BT_REMOTE_VERSION) && !atomic_test_bit(conn->flags, BT_CONN_AUTO_VERSION_INFO))) { return -EBUSY; diff --git a/subsys/bluetooth/host/conn_internal.h b/subsys/bluetooth/host/conn_internal.h index 1b9993e4836..d890368ee4e 100644 --- a/subsys/bluetooth/host/conn_internal.h +++ b/subsys/bluetooth/host/conn_internal.h @@ -71,7 +71,7 @@ enum { BT_CONN_ATT_MTU_EXCHANGED, /* If ATT MTU has been exchanged. */ #endif /* CONFIG_BT_GATT_CLIENT */ - BT_CONN_AUTO_FEATURE_EXCH, /* Auto-initiated LE Feat done */ + BT_CONN_LE_FEATURES_EXCHANGED, /* bt_conn.le.features is valid */ BT_CONN_AUTO_VERSION_INFO, /* Auto-initiated LE version done */ BT_CONN_CTE_RX_ENABLED, /* CTE receive and sampling is enabled */ @@ -103,6 +103,11 @@ struct bt_conn_le { uint8_t conn_param_retry_countdown; #endif + /** @brief Remote LE features + * + * Available after `atomic_test_bit(conn->flags, BT_CONN_LE_FEATURES_EXCHANGED)`. + * Signaled by bt_conn_cb.remote_info_available(). + */ uint8_t features[8]; struct bt_keys *keys; diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 427e0c18acd..1b2b1ac3704 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -1035,6 +1035,7 @@ static int hci_le_read_remote_features(struct bt_conn *conn) cp = net_buf_add(buf, sizeof(*cp)); cp->handle = sys_cpu_to_le16(conn->handle); + /* Results in BT_HCI_EVT_LE_REMOTE_FEAT_COMPLETE */ return bt_hci_cmd_send_sync(BT_HCI_OP_LE_READ_REMOTE_FEATURES, buf, NULL); } @@ -1206,7 +1207,7 @@ static void conn_auto_initiate(struct bt_conn *conn) return; } - if (!atomic_test_bit(conn->flags, BT_CONN_AUTO_FEATURE_EXCH) && + if (!atomic_test_bit(conn->flags, BT_CONN_LE_FEATURES_EXCHANGED) && ((conn->role == BT_HCI_ROLE_CENTRAL) || BT_FEAT_LE_PER_INIT_FEAT_XCHG(bt_dev.le.features))) { err = hci_le_read_remote_features(conn); @@ -1801,7 +1802,7 @@ static void le_remote_feat_complete(struct net_buf *buf) sizeof(conn->le.features)); } - atomic_set_bit(conn->flags, BT_CONN_AUTO_FEATURE_EXCH); + atomic_set_bit(conn->flags, BT_CONN_LE_FEATURES_EXCHANGED); if (IS_ENABLED(CONFIG_BT_REMOTE_INFO) && !IS_ENABLED(CONFIG_BT_REMOTE_VERSION)) {