switched auth to ESP_IO_CAP_OUT

This commit is contained in:
demik 2021-08-20 11:32:41 +02:00
parent 6d2455e7fe
commit b77015a9b2

View File

@ -598,14 +598,14 @@ esp_err_t esp_hid_ble_gap_adv_init(uint16_t appearance, const char *device_name)
};
esp_ble_auth_req_t auth_req = ESP_LE_AUTH_REQ_SC_MITM_BOND;
//esp_ble_io_cap_t iocap = ESP_IO_CAP_OUT;//you have to enter the key on the host
esp_ble_io_cap_t iocap = ESP_IO_CAP_OUT;//you have to enter the key on the host
//esp_ble_io_cap_t iocap = ESP_IO_CAP_IN;//you have to enter the key on the device
esp_ble_io_cap_t iocap = ESP_IO_CAP_IO;//you have to agree that key matches on both
//esp_ble_io_cap_t iocap = ESP_IO_CAP_IO;//you have to agree that key matches on both
//esp_ble_io_cap_t iocap = ESP_IO_CAP_NONE;//device is not capable of input or output, unsecure
uint8_t init_key = ESP_BLE_ENC_KEY_MASK | ESP_BLE_ID_KEY_MASK;
uint8_t rsp_key = ESP_BLE_ENC_KEY_MASK | ESP_BLE_ID_KEY_MASK;
uint8_t key_size = 16; //the key size should be 7~16 bytes
uint32_t passkey = 1234;//ESP_IO_CAP_OUT
uint32_t passkey = 484848;//ESP_IO_CAP_OUT
if ((ret = esp_ble_gap_set_security_param(ESP_BLE_SM_AUTHEN_REQ_MODE, &auth_req, 1)) != ESP_OK) {
ESP_LOGE(TAG, "GAP set_security_param AUTHEN_REQ_MODE failed: %d", ret);