Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth: GAP: SMP: check sc feature before pairing request #15

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/zephyr/bluetooth/hci_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ struct bt_hci_cmd_hdr {
#define BT_FEAT_LE(feat) BT_FEAT_TEST(feat, 0, 4, 6)
#define BT_FEAT_EXT_FEATURES(feat) BT_FEAT_TEST(feat, 0, 7, 7)
#define BT_FEAT_HOST_SSP(feat) BT_FEAT_TEST(feat, 1, 0, 0)
#define BT_FEAT_HOST_SC(feat) BT_FEAT_TEST(feat, 1, 0, 3)
#define BT_FEAT_SC(feat) BT_FEAT_TEST(feat, 2, 1, 0)

#define BT_FEAT_LMP_SCO_CAPABLE(feat) BT_FEAT_TEST(feat, 0, 1, 3)
Expand Down
4 changes: 3 additions & 1 deletion subsys/bluetooth/host/hci_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2235,7 +2235,9 @@ static void hci_encrypt_change(struct net_buf *buf)
* central on the link
*/
if (atomic_test_bit(conn->flags, BT_CONN_BR_PAIRED) &&
conn->role == BT_CONN_ROLE_CENTRAL) {
conn->role == BT_CONN_ROLE_CENTRAL &&
BT_FEAT_HOST_SC(conn->br.features) &&
BT_FEAT_SC(bt_dev.features)) {
bt_smp_br_send_pairing_req(conn);
}
}
Expand Down
Loading