mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-15 06:26:49 +00:00
components/bt: Optimization and bugfix of previous commits
This commit is contained in:
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user