diff --git a/emulator/bthost.c b/emulator/bthost.c
index 1fd9ef9..7f9af43 100644
--- a/emulator/bthost.c
+++ b/emulator/bthost.c
memset(bthost, 0, sizeof(*bthost));
+ /* Set defaults */
+ bthost->io_capability = 0x03;
+
return bthost;
}
cp.handle = cpu_to_le16(handle);
send_command(bthost, BT_HCI_CMD_AUTH_REQUESTED, &cp, sizeof(cp));
} else {
- smp_pair(conn->smp_data);
+ smp_pair(conn->smp_data, bthost->io_capability);
}
}
diff --git a/emulator/bthost.h b/emulator/bthost.h
index d7d3d8a..49a8649 100644
--- a/emulator/bthost.h
+++ b/emulator/bthost.h
void smp_conn_del(void *conn_data);
void smp_data(void *conn_data, const void *data, uint16_t len);
int smp_get_ltk(void *smp_data, uint64_t rand, uint16_t ediv, uint8_t *ltk);
-void smp_pair(void *conn_data);
+void smp_pair(void *conn_data, uint8_t io_cap);
diff --git a/emulator/smp.c b/emulator/smp.c
index 32c82e5..5a6c558 100644
--- a/emulator/smp.c
+++ b/emulator/smp.c
bthost_send_cid(bthost, conn->handle, SMP_CID, rsp, sizeof(rsp));
}
-void smp_pair(void *conn_data)
+void smp_pair(void *conn_data, uint8_t io_cap)
{
struct smp_conn *conn = conn_data;
struct bthost *bthost = conn->smp->bthost;
const uint8_t smp_pair_req[] = { 0x01, /* Pairing Request */
- 0x03, /* NoInputNoOutput */
+ io_cap, /* IO Capability */
0x00, /* OOB Flag */
0x01, /* Bonding - no MITM */
0x10, /* Max key size */