From b77015a9b207bf0d498211fddea5ae3f4b894d18 Mon Sep 17 00:00:00 2001 From: demik Date: Fri, 20 Aug 2021 11:32:41 +0200 Subject: [PATCH] switched auth to ESP_IO_CAP_OUT --- main/esp_hid_gap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main/esp_hid_gap.c b/main/esp_hid_gap.c index 30b6dd5..974a97a 100644 --- a/main/esp_hid_gap.c +++ b/main/esp_hid_gap.c @@ -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);