From: Jiang Jiang Jian Date: Wed, 2 Jan 2019 06:02:58 +0000 (+0800) Subject: Merge branch 'bugfix/btdm_debug_numeric_comparison_mode' into 'master' X-Git-Tag: v3.3-beta2~133 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1de94b7b45ca03bd41819ccf240fe2d87e681987;p=esp-idf Merge branch 'bugfix/btdm_debug_numeric_comparison_mode' into 'master' component/bt: modify the BLE example to make it run with "numeric comparison" mode See merge request idf/esp-idf!3500 --- 1de94b7b45ca03bd41819ccf240fe2d87e681987 diff --cc examples/bluetooth/gatt_security_server/main/example_ble_sec_gatts_demo.c index 3d602fd7a1,cf2062c039..b509fa7f51 --- a/examples/bluetooth/gatt_security_server/main/example_ble_sec_gatts_demo.c +++ b/examples/bluetooth/gatt_security_server/main/example_ble_sec_gatts_demo.c @@@ -310,14 -316,12 +310,15 @@@ static void gap_event_handler(esp_gap_b break; case ESP_GAP_BLE_PASSKEY_REQ_EVT: /* passkey request event */ ESP_LOGI(GATTS_TABLE_TAG, "ESP_GAP_BLE_PASSKEY_REQ_EVT"); + /* Call the following function to input the passkey which is displayed on the remote device */ //esp_ble_passkey_reply(heart_rate_profile_tab[HEART_PROFILE_APP_IDX].remote_bda, true, 0x00); break; - case ESP_GAP_BLE_OOB_REQ_EVT: /* OOB request event */ + case ESP_GAP_BLE_OOB_REQ_EVT: { ESP_LOGI(GATTS_TABLE_TAG, "ESP_GAP_BLE_OOB_REQ_EVT"); + uint8_t tk[16] = {1}; //If you paired with OOB, both devices need to use the same tk + esp_ble_oob_req_reply(param->ble_security.ble_req.bd_addr, tk, sizeof(tk)); break; + } case ESP_GAP_BLE_LOCAL_IR_EVT: /* BLE local IR event */ ESP_LOGI(GATTS_TABLE_TAG, "ESP_GAP_BLE_LOCAL_IR_EVT"); break;