Merge branch 'bugfix/ble_comfirm_reply_not_work_#12881' into 'master'

component/bt: Added the esp_ble_passkey_reply BTC_GAP_BLE_PASSKEY_REPLY_EVT &BTC…

See merge request !793
pull/639/merge
Jiang Jiang Jian 2017-05-27 14:40:26 +08:00
commit 636d2b384e
1 zmienionych plików z 14 dodań i 5 usunięć

Wyświetl plik

@ -907,16 +907,14 @@ void btc_gap_ble_call_handler(btc_msg_t *msg)
arg->cfg_scan_rsp_data_raw.raw_scan_rsp_len,
btc_scan_rsp_data_raw_callback);
break;
case BTC_GAP_BLE_SET_ENCRYPTION_EVT: {
#if (SMP_INCLUDED == TRUE)
case BTC_GAP_BLE_SET_ENCRYPTION_EVT: {
BD_ADDR bd_addr;
memcpy(bd_addr, arg->set_encryption.bd_addr, sizeof(BD_ADDR));
BTA_DmSetEncryption(bd_addr, BT_TRANSPORT_LE, btc_set_encryption_callback,
(tBTA_DM_BLE_SEC_ACT)arg->set_encryption.sec_act);
#endif ///SMP_INCLUDED == TRUE
break;
}
case BTC_GAP_BLE_SET_SECURITY_PARAM_EVT: {
switch(arg->set_security_param.param_type) {
case ESP_BLE_SM_PASSKEY:
@ -957,14 +955,25 @@ void btc_gap_ble_call_handler(btc_msg_t *msg)
break;
}
case BTC_GAP_BLE_SECURITY_RSP_EVT: {
#if (SMP_INCLUDED == TRUE)
BD_ADDR bd_addr;
tBTA_DM_BLE_SEC_GRANT res = arg->sec_rsp.accept ? BTA_DM_SEC_GRANTED : BTA_DM_SEC_PAIR_NOT_SPT;
memcpy(bd_addr, arg->sec_rsp.bd_addr, sizeof(BD_ADDR));
BTA_DmBleSecurityGrant(bd_addr, res);
break;
#endif ///SMP_INCLUDED == TRUE
}
case BTC_GAP_BLE_PASSKEY_REPLY_EVT: {
BD_ADDR bd_addr;
memcpy(bd_addr, arg->enc_passkey_replay.bd_addr, sizeof(BD_ADDR));
BTA_DmBlePasskeyReply(bd_addr, arg->enc_passkey_replay.accept, arg->enc_passkey_replay.passkey);
break;
}
case BTC_GAP_BLE_CONFIRM_REPLY_EVT: {
BD_ADDR bd_addr;
memcpy(bd_addr, arg->enc_comfirm_replay.bd_addr, sizeof(BD_ADDR));
BTA_DmBleConfirmReply(bd_addr, arg->enc_comfirm_replay.accept);
break;
}
#endif ///SMP_INCLUDED == TRUE
default:
break;
}