From 162882534bc1c67a82717d2d4dfb795e560c1b83 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Mon, 13 Jan 2014 14:29:36 +0200 Subject: [PATCH] emulator: Fix SSP rejection status propagation --- emulator/btdev.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/emulator/btdev.c b/emulator/btdev.c index 0baf93b5b..22680a2c8 100644 --- a/emulator/btdev.c +++ b/emulator/btdev.c @@ -58,7 +58,8 @@ struct btdev { 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; @@ -1254,11 +1255,16 @@ static void ssp_complete(struct btdev *btdev, const uint8_t *bdaddr, 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; -- 2.47.3