diff options
-rw-r--r-- | btif/src/btif_dm.c | 19 | ||||
-rwxr-xr-x[-rw-r--r--] | stack/btm/btm_sec.c | 2 |
2 files changed, 19 insertions, 2 deletions
diff --git a/btif/src/btif_dm.c b/btif/src/btif_dm.c index 55300d5..df4998d 100644 --- a/btif/src/btif_dm.c +++ b/btif/src/btif_dm.c @@ -641,7 +641,6 @@ static void btif_dm_auth_cmpl_evt (tBTA_DM_AUTH_CMPL *p_auth_cmpl) __FUNCTION__, p_auth_cmpl->key_type, pairing_cb.is_temp); } } - if (p_auth_cmpl->success) { status = BT_STATUS_SUCCESS; @@ -650,7 +649,25 @@ static void btif_dm_auth_cmpl_evt (tBTA_DM_AUTH_CMPL *p_auth_cmpl) /* Trigger SDP on the device */ btif_dm_get_remote_services(&bd_addr); } + else + { + /*Map the HCI fail reason to bt status */ + switch(p_auth_cmpl->fail_reason) + { + case HCI_ERR_PAGE_TIMEOUT: + case HCI_ERR_CONNECTION_TOUT: + status = BT_STATUS_RMT_DEV_DOWN; + break; + case HCI_ERR_AUTH_FAILURE: + status = BT_STATUS_AUTH_FAILURE; + break; + + default: + status = BT_STATUS_FAIL; + } + + } bond_state_changed(status, &bd_addr, state); } diff --git a/stack/btm/btm_sec.c b/stack/btm/btm_sec.c index bdf7f95..a845acc 100644..100755 --- a/stack/btm/btm_sec.c +++ b/stack/btm/btm_sec.c @@ -4358,7 +4358,7 @@ void btm_sec_disconnected (UINT16 handle, UINT8 reason) result = HCI_ERR_HOST_REJECT_SECURITY; } (*btm_cb.api.p_auth_complete_callback) (p_dev_rec->bd_addr, p_dev_rec->dev_class, - p_dev_rec->sec_bd_name, reason); + p_dev_rec->sec_bd_name, result); } } |