]> granicus.if.org Git - esp-idf/commitdiff
Merge branch 'bugfix/btdm_debug_numeric_comparison_mode' into 'master'
authorJiang Jiang Jian <jack@espressif.com>
Wed, 2 Jan 2019 06:02:58 +0000 (14:02 +0800)
committerJiang Jiang Jian <jack@espressif.com>
Wed, 2 Jan 2019 06:02:58 +0000 (14:02 +0800)
component/bt: modify the BLE example to make it run with "numeric comparison" mode

See merge request idf/esp-idf!3500

1  2 
components/bt/bluedroid/api/include/api/esp_gap_ble_api.h
examples/bluetooth/gatt_security_client/main/example_ble_sec_gattc_demo.c
examples/bluetooth/gatt_security_server/main/example_ble_sec_gatts_demo.c

index 3d602fd7a13aa4c6a44ae537d5f1e3403667fd56,cf2062c039ca5bf50017720a7bd043d11416ebaa..b509fa7f51928ccebf71780956363a0a67508884
@@@ -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;