diff --git a/emulator/btdev.c b/emulator/btdev.c
index 0baf93b..22680a2 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
uint16_t pin[16];
uint8_t pin_len;
uint8_t io_cap;
- bool ssp_auth_rsp;
+ bool ssp_auth_complete;
+ uint8_t ssp_status;
btdev_command_func command_handler;
void *command_data;
if (!remote)
return;
- btdev->ssp_auth_rsp = true;
+ btdev->ssp_status = status;
+ btdev->ssp_auth_complete = true;
- if (!remote->ssp_auth_rsp)
+ if (!remote->ssp_auth_complete)
return;
+ if (status == BT_HCI_ERR_SUCCESS &&
+ remote->ssp_status != BT_HCI_ERR_SUCCESS)
+ status = remote->ssp_status;
+
iev.status = status;
aev.status = status;