Merge branch 'bugfix/btdm_auth_val_error_#12962' into 'master'

component/bt: correct the security demo pair status code.

See merge request !841
This commit is contained in:
Jiang Jiang Jian 2017-06-13 18:14:39 +08:00
commit be680a0ef3
3 changed files with 4 additions and 4 deletions

View File

@ -183,7 +183,7 @@ typedef enum {
ESP_BLE_SM_AUTHEN_REQ_MODE, ESP_BLE_SM_AUTHEN_REQ_MODE,
ESP_BLE_SM_IOCAP_MODE, ESP_BLE_SM_IOCAP_MODE,
ESP_BLE_SM_SET_INIT_KEY, ESP_BLE_SM_SET_INIT_KEY,
ESP_BLE_SM_SET_RSP_KEK, ESP_BLE_SM_SET_RSP_KEY,
ESP_BLE_SM_MAX_KEY_SIZE, ESP_BLE_SM_MAX_KEY_SIZE,
} esp_ble_sm_param_t; } esp_ble_sm_param_t;

View File

@ -999,7 +999,7 @@ void btc_gap_ble_call_handler(btc_msg_t *msg)
bta_dm_co_ble_set_init_key_req(init_key); bta_dm_co_ble_set_init_key_req(init_key);
break; break;
} }
case ESP_BLE_SM_SET_RSP_KEK: { case ESP_BLE_SM_SET_RSP_KEY: {
uint8_t rsp_key = 0; uint8_t rsp_key = 0;
STREAM_TO_UINT8(rsp_key, arg->set_security_param.value); STREAM_TO_UINT8(rsp_key, arg->set_security_param.value);
bta_dm_co_ble_set_rsp_key_req(rsp_key); bta_dm_co_ble_set_rsp_key_req(rsp_key);

View File

@ -258,7 +258,7 @@ static void gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param
(bd_addr[0] << 24) + (bd_addr[1] << 16) + (bd_addr[2] << 8) + bd_addr[3], (bd_addr[0] << 24) + (bd_addr[1] << 16) + (bd_addr[2] << 8) + bd_addr[3],
(bd_addr[4] << 8) + bd_addr[5]); (bd_addr[4] << 8) + bd_addr[5]);
ESP_LOGI(GATTS_TABLE_TAG, "address type = %d", param->ble_security.auth_cmpl.addr_type); ESP_LOGI(GATTS_TABLE_TAG, "address type = %d", param->ble_security.auth_cmpl.addr_type);
ESP_LOGI(GATTS_TABLE_TAG, "pair status = %s",param->ble_security.auth_cmpl.success ? "fail" : "success"); ESP_LOGI(GATTS_TABLE_TAG, "pair status = %s",param->ble_security.auth_cmpl.success ? "success" : "fail");
break; break;
} }
default: default:
@ -404,7 +404,7 @@ void app_main()
esp_ble_gap_set_security_param(ESP_BLE_SM_IOCAP_MODE, &iocap, sizeof(uint8_t)); esp_ble_gap_set_security_param(ESP_BLE_SM_IOCAP_MODE, &iocap, sizeof(uint8_t));
esp_ble_gap_set_security_param(ESP_BLE_SM_MAX_KEY_SIZE, &key_size, sizeof(uint8_t)); esp_ble_gap_set_security_param(ESP_BLE_SM_MAX_KEY_SIZE, &key_size, sizeof(uint8_t));
esp_ble_gap_set_security_param(ESP_BLE_SM_SET_INIT_KEY, &init_key, sizeof(uint8_t)); esp_ble_gap_set_security_param(ESP_BLE_SM_SET_INIT_KEY, &init_key, sizeof(uint8_t));
esp_ble_gap_set_security_param(ESP_BLE_SM_SET_RSP_KEK, &rsp_key, sizeof(uint8_t)); esp_ble_gap_set_security_param(ESP_BLE_SM_SET_RSP_KEY, &rsp_key, sizeof(uint8_t));
} }