mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
fix(bt/bluedroid): Optimize compatibility with IOS and MACOS devices
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/* This example code is in the Public Domain (or CC0 licensed, at your option.)
|
||||
Unless required by applicable law or agreed to in writing, this software is
|
||||
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
||||
CONDITIONS OF ANY KIND, either express or implied.
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -343,7 +343,6 @@ static void ble_hidd_event_callback(void *handler_args, esp_event_base_t base, i
|
||||
}
|
||||
case ESP_HIDD_CONNECT_EVENT: {
|
||||
ESP_LOGI(TAG, "CONNECT");
|
||||
ble_hid_task_start_up();//todo: this should be on auth_complete (in GAP)
|
||||
break;
|
||||
}
|
||||
case ESP_HIDD_PROTOCOL_MODE_EVENT: {
|
||||
|
||||
@@ -464,7 +464,7 @@ static esp_err_t start_bt_scan(uint32_t seconds)
|
||||
/*
|
||||
* BLE GAP
|
||||
* */
|
||||
|
||||
extern void ble_hid_task_start_up(void);
|
||||
static void ble_gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param)
|
||||
{
|
||||
switch (event) {
|
||||
@@ -513,10 +513,12 @@ static void ble_gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_p
|
||||
* */
|
||||
case ESP_GAP_BLE_AUTH_CMPL_EVT:
|
||||
if (!param->ble_security.auth_cmpl.success) {
|
||||
// if AUTH ERROR,hid maybe don't work.
|
||||
ESP_LOGE(TAG, "BLE GAP AUTH ERROR: 0x%x", param->ble_security.auth_cmpl.fail_reason);
|
||||
} else {
|
||||
ESP_LOGI(TAG, "BLE GAP AUTH SUCCESS");
|
||||
}
|
||||
ble_hid_task_start_up();
|
||||
break;
|
||||
|
||||
case ESP_GAP_BLE_KEY_EVT: //shows the ble key info share with peer device to the user.
|
||||
|
||||
Reference in New Issue
Block a user