Bluetooth: BR/EDR: Set user mode flag on User Passkey Entry
Adds user flag to enable a user to input interactively requested passkey and releases the context flag after user interaction is finished. Change-Id: I5822ebdf5a7a78578d927d8b0cb272656cb26142 Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
This commit is contained in:
parent
6f30525278
commit
14abcf8281
1 changed files with 6 additions and 0 deletions
|
@ -881,6 +881,7 @@ void bt_conn_ssp_auth(struct bt_conn *conn, uint32_t passkey)
|
||||||
bt_auth->passkey_display(conn, passkey);
|
bt_auth->passkey_display(conn, passkey);
|
||||||
break;
|
break;
|
||||||
case PASSKEY_INPUT:
|
case PASSKEY_INPUT:
|
||||||
|
atomic_set_bit(conn->flags, BT_CONN_USER);
|
||||||
bt_auth->passkey_entry(conn);
|
bt_auth->passkey_entry(conn);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -1442,6 +1443,11 @@ int bt_conn_auth_passkey_entry(struct bt_conn *conn, unsigned int passkey)
|
||||||
#endif /* CONFIG_BLUETOOTH_SMP */
|
#endif /* CONFIG_BLUETOOTH_SMP */
|
||||||
#if defined(CONFIG_BLUETOOTH_BREDR)
|
#if defined(CONFIG_BLUETOOTH_BREDR)
|
||||||
if (conn->type == BT_CONN_TYPE_BR) {
|
if (conn->type == BT_CONN_TYPE_BR) {
|
||||||
|
/* User entered passkey, reset user state. */
|
||||||
|
if (!atomic_test_and_clear_bit(conn->flags, BT_CONN_USER)) {
|
||||||
|
return -EPERM;
|
||||||
|
}
|
||||||
|
|
||||||
if (conn->br.ssp_method == PASSKEY_INPUT) {
|
if (conn->br.ssp_method == PASSKEY_INPUT) {
|
||||||
return ssp_passkey_reply(conn, passkey);
|
return ssp_passkey_reply(conn, passkey);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue