components/bt: Optimization and bugfix of previous commits

This commit is contained in:
baohongde
2019-06-21 11:55:45 +08:00
parent 8024fcb296
commit 149e07911d
29 changed files with 451 additions and 331 deletions

View File

@@ -974,13 +974,14 @@ void smp_proc_pairing_cmpl(tSMP_CB *p_cb)
tSMP_EVT_DATA evt_data = {0};
tSMP_CALLBACK *p_callback = p_cb->p_callback;
BD_ADDR pairing_bda;
tBTM_SEC_DEV_REC *p_rec = btm_find_dev (p_cb->pairing_bda);
SMP_TRACE_DEBUG ("smp_proc_pairing_cmpl \n");
evt_data.cmplt.reason = p_cb->status;
evt_data.cmplt.smp_over_br = p_cb->smp_over_br;
evt_data.cmplt.auth_mode = 0;
#if (BLE_INCLUDED == TRUE)
tBTM_SEC_DEV_REC *p_rec = btm_find_dev (p_cb->pairing_bda);
if (p_cb->status == SMP_SUCCESS) {
evt_data.cmplt.sec_level = p_cb->sec_level;
if (p_cb->auth_mode) { // the first encryption
@@ -992,6 +993,12 @@ void smp_proc_pairing_cmpl(tSMP_CB *p_cb)
evt_data.cmplt.auth_mode = p_rec->ble.auth_mode;
}
}
#else
if (p_cb->status == SMP_SUCCESS) {
evt_data.cmplt.sec_level = p_cb->sec_level;
evt_data.cmplt.auth_mode = p_cb->auth_mode;
}
#endif
evt_data.cmplt.is_pair_cancel = FALSE;