Skip to content

Commit e772c45

Browse files
lylezhu2012aescolar
authored andcommitted
Bluetooth: SSP: Support non-bondable mode
If the return value of function bt_get_bondable is false, clear the bonding flag when controller requiring `Authentication_Requirements`. Signed-off-by: Lyle Zhu <[email protected]>
1 parent c0ce5b4 commit e772c45

File tree

1 file changed

+8
-0
lines changed
  • subsys/bluetooth/host/classic

1 file changed

+8
-0
lines changed

subsys/bluetooth/host/classic/ssp.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,9 @@ void bt_hci_io_capa_resp(struct net_buf *buf)
642642
bt_conn_unref(conn);
643643
}
644644

645+
/* Clear Bonding flag */
646+
#define BT_HCI_SET_NO_BONDING(auth) ((auth) & 0x01)
647+
645648
void bt_hci_io_capa_req(struct net_buf *buf)
646649
{
647650
struct bt_hci_evt_io_capa_req *evt = (void *)buf->data;
@@ -690,6 +693,11 @@ void bt_hci_io_capa_req(struct net_buf *buf)
690693
auth = ssp_get_auth(conn);
691694
}
692695

696+
if (!bt_get_bondable()) {
697+
/* If bondable is false, clear bonding flag. */
698+
auth = BT_HCI_SET_NO_BONDING(auth);
699+
}
700+
693701
cp = net_buf_add(resp_buf, sizeof(*cp));
694702
bt_addr_copy(&cp->bdaddr, &evt->bdaddr);
695703
cp->capability = get_io_capa();

0 commit comments

Comments
 (0)