From f881e165ec09b45ff683bac4e5c84db66025a9ac Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Mon, 13 Jan 2014 12:57:58 +0200 Subject: emulator/bthost: Request encryption when authentication completes --- emulator/bthost.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'emulator') diff --git a/emulator/bthost.c b/emulator/bthost.c index 96d375f23..5afc11ee5 100644 --- a/emulator/bthost.c +++ b/emulator/bthost.c @@ -682,9 +682,15 @@ static void evt_auth_complete(struct bthost *bthost, const void *data, uint8_t len) { const struct bt_hci_evt_auth_complete *ev = data; + struct bt_hci_cmd_set_conn_encrypt cp; if (len < sizeof(*ev)) return; + + cp.handle = ev->handle; + cp.encr_mode = 0x01; + + send_command(bthost, BT_HCI_CMD_SET_CONN_ENCRYPT, &cp, sizeof(cp)); } static void evt_pin_code_request(struct bthost *bthost, const void *data, -- cgit v1.2.1