diff --git a/emulator/bthost.c b/emulator/bthost.c
index c627f8a..83bfdee 100644
--- a/emulator/bthost.c
+++ b/emulator/bthost.c
struct btconn {
uint16_t handle;
uint8_t addr_type;
+ uint8_t encr_mode;
uint16_t next_cid;
struct l2conn *l2conns;
struct cid_hook *cid_hooks;
return;
}
+static void evt_encrypt_change(struct bthost *bthost, const void *data,
+ uint8_t len)
+{
+ const struct bt_hci_evt_encrypt_change *ev = data;
+ struct btconn *conn;
+ uint16_t handle;
+
+ if (len < sizeof(*ev))
+ return;
+
+ handle = acl_handle(ev->handle);
+ conn = bthost_find_conn(bthost, handle);
+ if (!conn)
+ return;
+
+ conn->encr_mode = ev->encr_mode;
+}
+
static void evt_le_conn_complete(struct bthost *bthost, const void *data,
uint8_t len)
{
evt_num_completed_packets(bthost, param, hdr->plen);
break;
+ case BT_HCI_EVT_ENCRYPT_CHANGE:
+ evt_encrypt_change(bthost, param, hdr->plen);
+ break;
+
case BT_HCI_EVT_LE_META_EVENT:
evt_le_meta_event(bthost, param, hdr->plen);
break;