Re: [RFC] btdev: Send Link Key Request on Authentication Requested

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Andrei,

> From: Andrei Emeltchenko <andrei.emeltchenko@xxxxxxxxx>
> 
> The Link Key Request event shall be generated when Simple Pairing Mode
> is enabled.
> ---
> emulator/btdev.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
> 
> diff --git a/emulator/btdev.c b/emulator/btdev.c
> index b1e804b..c0cfdef 100644
> --- a/emulator/btdev.c
> +++ b/emulator/btdev.c
> @@ -2005,6 +2005,19 @@ static void default_cmd_completion(struct btdev *btdev, uint16_t opcode,
> 		conn_complete(btdev, rcr->bdaddr, BT_HCI_ERR_UNKNOWN_CONN_ID);
> 		break;
> 
> +	case BT_HCI_CMD_AUTH_REQUESTED:
> +		if (btdev->type == BTDEV_TYPE_LE)
> +			return;

please make sure that you send correct command status event first. The Core specification is pretty detailed on what needs to be send when here.

> +
> +		if (btdev->simple_pairing_mode) {
> +			struct bt_hci_evt_link_key_request lkr;
> +
> +			memcpy(lkr.bdaddr, btdev->conn->bdaddr, 6);
> +			send_event(btdev, BT_HCI_EVT_LINK_KEY_REQUEST, &lkr,
> +								sizeof(lkr));
> +		}
> +		break;
> +
> 	case BT_HCI_CMD_REMOTE_NAME_REQUEST:
> 		if (btdev->type == BTDEV_TYPE_LE)
> 			return;

Regards

Marcel

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux