diff --git a/emulator/bthost.c b/emulator/bthost.c
index 0c5836f..03d5d75 100644
--- a/emulator/bthost.c
+++ b/emulator/bthost.c
send_command(bthost, BT_HCI_CMD_LE_SET_ADV_ENABLE, &enable, 1);
}
+void bthost_le_start_encrypt(struct bthost *bthost, uint16_t handle,
+ const uint8_t ltk[16])
+{
+ struct bt_hci_cmd_le_start_encrypt cmd;
+
+ printf("bthost_le_start_encrypt(handle %u)\n", handle);
+
+ memset(&cmd, 0, sizeof(cmd));
+ cmd.handle = htobs(handle);
+ memcpy(cmd.ltk, ltk, 16);
+
+ send_command(bthost, BT_HCI_CMD_LE_START_ENCRYPT, &cmd, sizeof(cmd));
+}
+
void bthost_set_server_psm(struct bthost *bthost, uint16_t psm)
{
bthost->server_psm = psm;
diff --git a/emulator/bthost.h b/emulator/bthost.h
index 32b10f9..474ada9 100644
--- a/emulator/bthost.h
+++ b/emulator/bthost.h
void bthost_set_adv_enable(struct bthost *bthost, uint8_t enable);
+void bthost_le_start_encrypt(struct bthost *bthost, uint16_t handle,
+ const uint8_t ltk[16]);
+
void bthost_set_server_psm(struct bthost *bthost, uint16_t psm);
void bthost_start(struct bthost *bthost);