diff --git a/components/bt/host/bluedroid/api/esp_gattc_api.c b/components/bt/host/bluedroid/api/esp_gattc_api.c index d59de8ed9d..4c41de97de 100644 --- a/components/bt/host/bluedroid/api/esp_gattc_api.c +++ b/components/bt/host/bluedroid/api/esp_gattc_api.c @@ -68,7 +68,7 @@ esp_err_t esp_ble_gattc_app_unregister(esp_gatt_if_t gattc_if) return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL); } -esp_err_t esp_ble_gattc_enh_open(esp_gatt_if_t gattc_if, esp_ble_gatt_creat_conn_params_t esp_gatt_create_conn) +esp_err_t esp_ble_gattc_enh_open(esp_gatt_if_t gattc_if, esp_ble_gatt_creat_conn_params_t *creat_conn_params) { btc_msg_t msg = {0}; btc_ble_gattc_args_t arg; @@ -79,11 +79,11 @@ esp_err_t esp_ble_gattc_enh_open(esp_gatt_if_t gattc_if, esp_ble_gatt_creat_conn msg.pid = BTC_PID_GATTC; msg.act = BTC_GATTC_ACT_OPEN; arg.open.gattc_if = gattc_if; - memcpy(arg.open.remote_bda, esp_gatt_create_conn.remote_bda, ESP_BD_ADDR_LEN); - arg.open.remote_addr_type = esp_gatt_create_conn.remote_addr_type; - arg.open.is_direct = esp_gatt_create_conn.is_direct; - arg.open.is_aux= esp_gatt_create_conn.is_aux; - arg.open.own_addr_type = esp_gatt_create_conn.own_addr_type; + memcpy(arg.open.remote_bda, creat_conn_params->remote_bda, ESP_BD_ADDR_LEN); + arg.open.remote_addr_type = creat_conn_params->remote_addr_type; + arg.open.is_direct = creat_conn_params->is_direct; + arg.open.is_aux= creat_conn_params->is_aux; + arg.open.own_addr_type = creat_conn_params->own_addr_type; return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL); } @@ -91,26 +91,26 @@ esp_err_t esp_ble_gattc_enh_open(esp_gatt_if_t gattc_if, esp_ble_gatt_creat_conn #if (BLE_42_FEATURE_SUPPORT == TRUE) esp_err_t esp_ble_gattc_open(esp_gatt_if_t gattc_if, esp_bd_addr_t remote_bda, esp_ble_addr_type_t remote_addr_type, bool is_direct) { - esp_ble_gatt_creat_conn_params_t esp_gatt_create_conn; - memcpy(esp_gatt_create_conn.remote_bda, remote_bda, ESP_BD_ADDR_LEN); - esp_gatt_create_conn.remote_addr_type = remote_addr_type; - esp_gatt_create_conn.is_direct = is_direct; - esp_gatt_create_conn.is_aux = false; - esp_gatt_create_conn.own_addr_type = 0xff; //undefined, will use local value - return esp_ble_gattc_enh_open(gattc_if, esp_gatt_create_conn); + esp_ble_gatt_creat_conn_params_t creat_conn_params; + memcpy(creat_conn_params.remote_bda, remote_bda, ESP_BD_ADDR_LEN); + creat_conn_params.remote_addr_type = remote_addr_type; + creat_conn_params.is_direct = is_direct; + creat_conn_params.is_aux = false; + creat_conn_params.own_addr_type = 0xff; //undefined, will use local value + return esp_ble_gattc_enh_open(gattc_if, &creat_conn_params); } #endif // #if (BLE_42_FEATURE_SUPPORT == TRUE) #if (BLE_50_FEATURE_SUPPORT == TRUE) esp_err_t esp_ble_gattc_aux_open(esp_gatt_if_t gattc_if, esp_bd_addr_t remote_bda, esp_ble_addr_type_t remote_addr_type, bool is_direct) { - esp_ble_gatt_creat_conn_params_t esp_gatt_create_conn; - memcpy(esp_gatt_create_conn.remote_bda, remote_bda, ESP_BD_ADDR_LEN); - esp_gatt_create_conn.remote_addr_type = remote_addr_type; - esp_gatt_create_conn.is_direct = is_direct; - esp_gatt_create_conn.is_aux = true; - esp_gatt_create_conn.own_addr_type = 0xff; //undefined, will use local value - return esp_ble_gattc_enh_open(gattc_if, esp_gatt_create_conn); + esp_ble_gatt_creat_conn_params_t creat_conn_params; + memcpy(creat_conn_params.remote_bda, remote_bda, ESP_BD_ADDR_LEN); + creat_conn_params.remote_addr_type = remote_addr_type; + creat_conn_params.is_direct = is_direct; + creat_conn_params.is_aux = true; + creat_conn_params.own_addr_type = 0xff; //undefined, will use local value + return esp_ble_gattc_enh_open(gattc_if, &creat_conn_params); } #endif // #if (BLE_50_FEATURE_SUPPORT == TRUE) diff --git a/components/bt/host/bluedroid/api/include/api/esp_gattc_api.h b/components/bt/host/bluedroid/api/include/api/esp_gattc_api.h index 442fec2e53..a4fd3c9574 100644 --- a/components/bt/host/bluedroid/api/include/api/esp_gattc_api.h +++ b/components/bt/host/bluedroid/api/include/api/esp_gattc_api.h @@ -319,14 +319,14 @@ esp_err_t esp_ble_gattc_app_unregister(esp_gatt_if_t gattc_if); * Note: Do not enable both BLE_42_FEATURE_SUPPORT and BLE_50_FEATURE_SUPPORT configuration options simultaneously. * * @param[in] gattc_if: GATT client access interface. - * @param[in] esp_gatt_create_conn: Structure containing connection parameters. + * @param[in] esp_gatt_create_conn: Pointer to the structure containing connection parameters. * * @return * - ESP_OK: Operation successful * - others: Operation failed * */ -esp_err_t esp_ble_gattc_enh_open(esp_gatt_if_t gattc_if, esp_ble_gatt_creat_conn_params_t esp_gatt_create_conn); +esp_err_t esp_ble_gattc_enh_open(esp_gatt_if_t gattc_if, esp_ble_gatt_creat_conn_params_t *esp_gatt_create_conn); /** * @brief Open a direct connection or add a background auto connection diff --git a/components/esp_hid/src/ble_hidh.c b/components/esp_hid/src/ble_hidh.c index d5ecc189b3..4e907699df 100644 --- a/components/esp_hid/src/ble_hidh.c +++ b/components/esp_hid/src/ble_hidh.c @@ -672,14 +672,14 @@ esp_hidh_dev_t *esp_ble_hidh_dev_open(esp_bd_addr_t bda, esp_ble_addr_type_t add dev->ble.address_type = address_type; dev->ble.appearance = ESP_HID_APPEARANCE_GENERIC; - esp_ble_gatt_creat_conn_params_t esp_ble_gatt_create_conn; - memcpy(&esp_ble_gatt_create_conn.remote_bda, dev->addr.bda, ESP_BD_ADDR_LEN); - esp_ble_gatt_create_conn.remote_addr_type = dev->ble.address_type; - esp_ble_gatt_create_conn.own_addr_type = BLE_ADDR_TYPE_PUBLIC; - esp_ble_gatt_create_conn.is_direct = true; - esp_ble_gatt_create_conn.is_aux = false; + esp_ble_gatt_creat_conn_params_t creat_conn_params; + memcpy(&creat_conn_params.remote_bda, dev->addr.bda, ESP_BD_ADDR_LEN); + creat_conn_params.remote_addr_type = dev->ble.address_type; + creat_conn_params.own_addr_type = BLE_ADDR_TYPE_PUBLIC; + creat_conn_params.is_direct = true; + creat_conn_params.is_aux = false; ret = esp_ble_gattc_enh_open(hid_gattc_if, - esp_ble_gatt_create_conn); + &creat_conn_params); if (ret) { esp_hidh_dev_free_inner(dev); ESP_LOGE(TAG, "esp_ble_gattc_enh_open failed: %d", ret); diff --git a/examples/bluetooth/bluedroid/ble/ble_ancs/main/ble_ancs_demo.c b/examples/bluetooth/bluedroid/ble/ble_ancs/main/ble_ancs_demo.c index c3f3ec1d41..7e8e4458a8 100644 --- a/examples/bluetooth/bluedroid/ble/ble_ancs/main/ble_ancs_demo.c +++ b/examples/bluetooth/bluedroid/ble/ble_ancs/main/ble_ancs_demo.c @@ -565,14 +565,14 @@ static void gattc_profile_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_ //esp_log_buffer_hex("bda", param->connect.remote_bda, 6); memcpy(gl_profile_tab[PROFILE_A_APP_ID].remote_bda, param->connect.remote_bda, 6); // create gattc virtual connection - esp_ble_gatt_creat_conn_params_t esp_ble_gatt_create_conn; - memcpy(&esp_ble_gatt_create_conn.remote_bda, gl_profile_tab[PROFILE_A_APP_ID].remote_bda, ESP_BD_ADDR_LEN); - esp_ble_gatt_create_conn.remote_addr_type = BLE_ADDR_TYPE_RANDOM; - esp_ble_gatt_create_conn.own_addr_type = BLE_ADDR_TYPE_RPA_PUBLIC; - esp_ble_gatt_create_conn.is_direct = true; - esp_ble_gatt_create_conn.is_aux = false; + esp_ble_gatt_creat_conn_params_t creat_conn_params; + memcpy(&creat_conn_params.remote_bda, gl_profile_tab[PROFILE_A_APP_ID].remote_bda, ESP_BD_ADDR_LEN); + creat_conn_params.remote_addr_type = BLE_ADDR_TYPE_RANDOM; + creat_conn_params.own_addr_type = BLE_ADDR_TYPE_RPA_PUBLIC; + creat_conn_params.is_direct = true; + creat_conn_params.is_aux = false; esp_ble_gattc_enh_open(gl_profile_tab[PROFILE_A_APP_ID].gattc_if, - esp_ble_gatt_create_conn); + &creat_conn_params); break; case ESP_GATTC_DIS_SRVC_CMPL_EVT: ESP_LOGI(BLE_ANCS_TAG, "ESP_GATTC_DIS_SRVC_CMPL_EVT"); diff --git a/examples/bluetooth/bluedroid/ble/ble_spp_client/main/spp_client_demo.c b/examples/bluetooth/bluedroid/ble/ble_spp_client/main/spp_client_demo.c index f738552361..4616e979e8 100644 --- a/examples/bluetooth/bluedroid/ble/ble_spp_client/main/spp_client_demo.c +++ b/examples/bluetooth/bluedroid/ble/ble_spp_client/main/spp_client_demo.c @@ -238,14 +238,14 @@ static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *par ESP_LOGI(GATTC_TAG, "Scan stop successfully"); if (is_connect == false) { ESP_LOGI(GATTC_TAG, "Connect to the remote device."); - esp_ble_gatt_creat_conn_params_t esp_ble_gatt_create_conn; - memcpy(&esp_ble_gatt_create_conn.remote_bda, scan_rst.scan_rst.bda,ESP_BD_ADDR_LEN); - esp_ble_gatt_create_conn.remote_addr_type = scan_rst.scan_rst.ble_addr_type; - esp_ble_gatt_create_conn.own_addr_type = BLE_ADDR_TYPE_PUBLIC; - esp_ble_gatt_create_conn.is_direct = true; - esp_ble_gatt_create_conn.is_aux = false; + esp_ble_gatt_creat_conn_params_t creat_conn_params; + memcpy(&creat_conn_params.remote_bda, scan_rst.scan_rst.bda,ESP_BD_ADDR_LEN); + creat_conn_params.remote_addr_type = scan_rst.scan_rst.ble_addr_type; + creat_conn_params.own_addr_type = BLE_ADDR_TYPE_PUBLIC; + creat_conn_params.is_direct = true; + creat_conn_params.is_aux = false; esp_ble_gattc_enh_open(gl_profile_tab[PROFILE_APP_ID].gattc_if, - esp_ble_gatt_create_conn); + &creat_conn_params); } break; case ESP_GAP_BLE_SCAN_RESULT_EVT: { diff --git a/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_client/main/example_ble_client_throughput.c b/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_client/main/example_ble_client_throughput.c index a78e1e18e1..96b2885aaa 100644 --- a/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_client/main/example_ble_client_throughput.c +++ b/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_client/main/example_ble_client_throughput.c @@ -408,14 +408,14 @@ static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *par #endif esp_ble_gap_stop_scanning(); - esp_ble_gatt_creat_conn_params_t esp_ble_gatt_create_conn; - memcpy(&esp_ble_gatt_create_conn.remote_bda, scan_result->scan_rst.bda, ESP_BD_ADDR_LEN); - esp_ble_gatt_create_conn.remote_addr_type = scan_result->scan_rst.ble_addr_type; - esp_ble_gatt_create_conn.own_addr_type = BLE_ADDR_TYPE_PUBLIC; - esp_ble_gatt_create_conn.is_direct = true; - esp_ble_gatt_create_conn.is_aux = false; + esp_ble_gatt_creat_conn_params_t creat_conn_params; + memcpy(&creat_conn_params.remote_bda, scan_result->scan_rst.bda, ESP_BD_ADDR_LEN); + creat_conn_params.remote_addr_type = scan_result->scan_rst.ble_addr_type; + creat_conn_params.own_addr_type = BLE_ADDR_TYPE_PUBLIC; + creat_conn_params.is_direct = true; + creat_conn_params.is_aux = false; esp_ble_gattc_enh_open(gl_profile_tab[PROFILE_A_APP_ID].gattc_if, - esp_ble_gatt_create_conn); + &creat_conn_params); } } } diff --git a/examples/bluetooth/bluedroid/ble/gatt_client/main/gattc_demo.c b/examples/bluetooth/bluedroid/ble/gatt_client/main/gattc_demo.c index 5807a395ff..dacfea68a3 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_client/main/gattc_demo.c +++ b/examples/bluetooth/bluedroid/ble/gatt_client/main/gattc_demo.c @@ -368,14 +368,14 @@ static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *par connect = true; ESP_LOGI(GATTC_TAG, "Connect to the remote device"); esp_ble_gap_stop_scanning(); - esp_ble_gatt_creat_conn_params_t esp_ble_gatt_create_conn; - memcpy(&esp_ble_gatt_create_conn.remote_bda, scan_result->scan_rst.bda, ESP_BD_ADDR_LEN); - esp_ble_gatt_create_conn.remote_addr_type = scan_result->scan_rst.ble_addr_type; - esp_ble_gatt_create_conn.own_addr_type = BLE_ADDR_TYPE_PUBLIC; - esp_ble_gatt_create_conn.is_direct = true; - esp_ble_gatt_create_conn.is_aux = false; + esp_ble_gatt_creat_conn_params_t creat_conn_params; + memcpy(&creat_conn_params.remote_bda, scan_result->scan_rst.bda, ESP_BD_ADDR_LEN); + creat_conn_params.remote_addr_type = scan_result->scan_rst.ble_addr_type; + creat_conn_params.own_addr_type = BLE_ADDR_TYPE_PUBLIC; + creat_conn_params.is_direct = true; + creat_conn_params.is_aux = false; esp_ble_gattc_enh_open(gl_profile_tab[PROFILE_A_APP_ID].gattc_if, - esp_ble_gatt_create_conn); + &creat_conn_params); } } } diff --git a/examples/bluetooth/bluedroid/ble/gatt_client/tutorial/Gatt_Client_Example_Walkthrough.md b/examples/bluetooth/bluedroid/ble/gatt_client/tutorial/Gatt_Client_Example_Walkthrough.md index 7afaace6dd..3012f34c47 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_client/tutorial/Gatt_Client_Example_Walkthrough.md +++ b/examples/bluetooth/bluedroid/ble/gatt_client/tutorial/Gatt_Client_Example_Walkthrough.md @@ -377,7 +377,7 @@ We are interested in the `ESP_GAP_SEARCH_INQ_RES_EVT` event, which is called eve esp_ble_gatt_create_conn.is_direct = true; esp_ble_gatt_create_conn.is_aux = false; esp_ble_gattc_enh_open(gl_profile_tab[PROFILE_A_APP_ID].gattc_if, - esp_ble_gatt_create_conn); + &esp_ble_gatt_create_conn); } } } diff --git a/examples/bluetooth/bluedroid/ble/gatt_security_client/main/example_ble_sec_gattc_demo.c b/examples/bluetooth/bluedroid/ble/gatt_security_client/main/example_ble_sec_gattc_demo.c index cf56e5f757..a359db56c7 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_security_client/main/example_ble_sec_gattc_demo.c +++ b/examples/bluetooth/bluedroid/ble/gatt_security_client/main/example_ble_sec_gattc_demo.c @@ -470,7 +470,7 @@ static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *par esp_ble_gatt_create_conn.is_direct = true; esp_ble_gatt_create_conn.is_aux = false; esp_ble_gattc_enh_open(gl_profile_tab[PROFILE_A_APP_ID].gattc_if, - esp_ble_gatt_create_conn); + &esp_ble_gatt_create_conn); } } } diff --git a/examples/bluetooth/bluedroid/ble/gattc_multi_connect/main/gattc_multi_connect.c b/examples/bluetooth/bluedroid/ble/gattc_multi_connect/main/gattc_multi_connect.c index 1765dc8356..3dbe184554 100644 --- a/examples/bluetooth/bluedroid/ble/gattc_multi_connect/main/gattc_multi_connect.c +++ b/examples/bluetooth/bluedroid/ble/gattc_multi_connect/main/gattc_multi_connect.c @@ -817,14 +817,14 @@ static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *par conn_device_a = true; ESP_LOGI(GATTC_TAG, "Searched device %s", remote_device_name[0]); esp_ble_gap_stop_scanning(); - esp_ble_gatt_creat_conn_params_t esp_ble_gatt_create_conn; - memcpy(&esp_ble_gatt_create_conn.remote_bda, scan_result->scan_rst.bda, ESP_BD_ADDR_LEN); - esp_ble_gatt_create_conn.remote_addr_type = scan_result->scan_rst.ble_addr_type; - esp_ble_gatt_create_conn.own_addr_type = BLE_ADDR_TYPE_PUBLIC; - esp_ble_gatt_create_conn.is_direct = true; - esp_ble_gatt_create_conn.is_aux = false; + esp_ble_gatt_creat_conn_params_t creat_conn_params; + memcpy(&creat_conn_params.remote_bda, scan_result->scan_rst.bda, ESP_BD_ADDR_LEN); + creat_conn_params.remote_addr_type = scan_result->scan_rst.ble_addr_type; + creat_conn_params.own_addr_type = BLE_ADDR_TYPE_PUBLIC; + creat_conn_params.is_direct = true; + creat_conn_params.is_aux = false; esp_ble_gattc_enh_open(gl_profile_tab[PROFILE_A_APP_ID].gattc_if, - esp_ble_gatt_create_conn); + &creat_conn_params); Isconnecting = true; } break; @@ -834,14 +834,14 @@ static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *par conn_device_b = true; ESP_LOGI(GATTC_TAG, "Searched device %s", remote_device_name[1]); esp_ble_gap_stop_scanning(); - esp_ble_gatt_creat_conn_params_t esp_ble_gatt_create_conn; - memcpy(&esp_ble_gatt_create_conn.remote_bda, scan_result->scan_rst.bda, ESP_BD_ADDR_LEN); - esp_ble_gatt_create_conn.remote_addr_type = scan_result->scan_rst.ble_addr_type; - esp_ble_gatt_create_conn.own_addr_type = BLE_ADDR_TYPE_PUBLIC; - esp_ble_gatt_create_conn.is_direct = true; - esp_ble_gatt_create_conn.is_aux = false; + esp_ble_gatt_creat_conn_params_t creat_conn_params; + memcpy(&creat_conn_params.remote_bda, scan_result->scan_rst.bda, ESP_BD_ADDR_LEN); + creat_conn_params.remote_addr_type = scan_result->scan_rst.ble_addr_type; + creat_conn_params.own_addr_type = BLE_ADDR_TYPE_PUBLIC; + creat_conn_params.is_direct = true; + creat_conn_params.is_aux = false; esp_ble_gattc_enh_open(gl_profile_tab[PROFILE_A_APP_ID].gattc_if, - esp_ble_gatt_create_conn); + &creat_conn_params); Isconnecting = true; } @@ -851,14 +851,14 @@ static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *par conn_device_c = true; ESP_LOGI(GATTC_TAG, "Searched device %s", remote_device_name[2]); esp_ble_gap_stop_scanning(); - esp_ble_gatt_creat_conn_params_t esp_ble_gatt_create_conn; - memcpy(&esp_ble_gatt_create_conn.remote_bda, scan_result->scan_rst.bda, ESP_BD_ADDR_LEN); - esp_ble_gatt_create_conn.remote_addr_type = scan_result->scan_rst.ble_addr_type; - esp_ble_gatt_create_conn.own_addr_type = BLE_ADDR_TYPE_PUBLIC; - esp_ble_gatt_create_conn.is_direct = true; - esp_ble_gatt_create_conn.is_aux = false; + esp_ble_gatt_creat_conn_params_t creat_conn_params; + memcpy(&creat_conn_params.remote_bda, scan_result->scan_rst.bda, ESP_BD_ADDR_LEN); + creat_conn_params.remote_addr_type = scan_result->scan_rst.ble_addr_type; + creat_conn_params.own_addr_type = BLE_ADDR_TYPE_PUBLIC; + creat_conn_params.is_direct = true; + creat_conn_params.is_aux = false; esp_ble_gattc_enh_open(gl_profile_tab[PROFILE_A_APP_ID].gattc_if, - esp_ble_gatt_create_conn); + &creat_conn_params); Isconnecting = true; } break; diff --git a/examples/bluetooth/bluedroid/ble/gattc_multi_connect/tutorial/Gatt_Client_Multi_Connection_Example_Walkthrough.md b/examples/bluetooth/bluedroid/ble/gattc_multi_connect/tutorial/Gatt_Client_Multi_Connection_Example_Walkthrough.md index 6726b2e799..7f7439abd5 100644 --- a/examples/bluetooth/bluedroid/ble/gattc_multi_connect/tutorial/Gatt_Client_Multi_Connection_Example_Walkthrough.md +++ b/examples/bluetooth/bluedroid/ble/gattc_multi_connect/tutorial/Gatt_Client_Multi_Connection_Example_Walkthrough.md @@ -167,7 +167,7 @@ The scan stop triggers an ``ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT`` event which is esp_ble_gatt_create_conn.is_direct = true; esp_ble_gatt_create_conn.is_aux = false; esp_ble_gattc_enh_open(gl_profile_tab[PROFILE_A_APP_ID].gattc_if, - esp_ble_gatt_create_conn); + &esp_ble_gatt_create_conn); Isconnecting = true; } break; @@ -184,7 +184,7 @@ The scan stop triggers an ``ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT`` event which is esp_ble_gatt_create_conn.is_direct = true; esp_ble_gatt_create_conn.is_aux = false; esp_ble_gattc_enh_open(gl_profile_tab[PROFILE_A_APP_ID].gattc_if, - esp_ble_gatt_create_conn); + &esp_ble_gatt_create_conn); Isconnecting = true; } @@ -201,7 +201,7 @@ The scan stop triggers an ``ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT`` event which is esp_ble_gatt_create_conn.is_direct = true; esp_ble_gatt_create_conn.is_aux = false; esp_ble_gattc_enh_open(gl_profile_tab[PROFILE_A_APP_ID].gattc_if, - esp_ble_gatt_create_conn); + &esp_ble_gatt_create_conn); Isconnecting = true; } break; diff --git a/examples/bluetooth/bluedroid/ble_50/ble50_security_client/main/ble50_sec_gattc_demo.c b/examples/bluetooth/bluedroid/ble_50/ble50_security_client/main/ble50_sec_gattc_demo.c index 2ac1f9e604..11aac9a6f1 100644 --- a/examples/bluetooth/bluedroid/ble_50/ble50_security_client/main/ble50_sec_gattc_demo.c +++ b/examples/bluetooth/bluedroid/ble_50/ble50_security_client/main/ble50_sec_gattc_demo.c @@ -502,15 +502,14 @@ static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *par ESP_BLE_GAP_PHY_1M_PREF_MASK | ESP_BLE_GAP_PHY_2M_PREF_MASK | ESP_BLE_GAP_PHY_CODED_PREF_MASK , &phy_1m_conn_params, &phy_2m_conn_params, &phy_coded_conn_params); // create gattc virtual connection - esp_ble_gatt_creat_conn_params_t esp_ble_gatt_create_conn; - memcpy(&esp_ble_gatt_create_conn.remote_bda, param->ext_adv_report.params.addr, ESP_BD_ADDR_LEN); - esp_ble_gatt_create_conn.remote_addr_type = param->ext_adv_report.params.addr_type; - esp_ble_gatt_create_conn.own_addr_type = BLE_ADDR_TYPE_PUBLIC; - esp_ble_gatt_create_conn.is_direct = true; - esp_ble_gatt_create_conn.is_aux = true; - esp_ble_gattc_aux_open(gl_profile_tab[PROFILE_A_APP_ID].gattc_if, - param->ext_adv_report.params.addr, - param->ext_adv_report.params.addr_type, true); + esp_ble_gatt_creat_conn_params_t creat_conn_params; + memcpy(&creat_conn_params.remote_bda, param->ext_adv_report.params.addr, ESP_BD_ADDR_LEN); + creat_conn_params.remote_addr_type = param->ext_adv_report.params.addr_type; + creat_conn_params.own_addr_type = BLE_ADDR_TYPE_PUBLIC; + creat_conn_params.is_direct = true; + creat_conn_params.is_aux = true; + esp_ble_gattc_enh_open(gl_profile_tab[PROFILE_A_APP_ID].gattc_if, + &creat_conn_params); } break; diff --git a/examples/bluetooth/bluedroid/coex/gattc_gatts_coex/main/gattc_gatts_coex.c b/examples/bluetooth/bluedroid/coex/gattc_gatts_coex/main/gattc_gatts_coex.c index 7ef9d94a46..70cafda4f5 100644 --- a/examples/bluetooth/bluedroid/coex/gattc_gatts_coex/main/gattc_gatts_coex.c +++ b/examples/bluetooth/bluedroid/coex/gattc_gatts_coex/main/gattc_gatts_coex.c @@ -307,14 +307,14 @@ static void gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param // Initiate GATT connection with the remote device, // If ble physical connection is set up, ESP_GATTS_CONNECT_EVT and ESP_GATTC_CONNECT_EVT event will come - esp_ble_gatt_creat_conn_params_t esp_ble_gatt_create_conn; - memcpy(&esp_ble_gatt_create_conn.remote_bda, scan_result->scan_rst.bda, ESP_BD_ADDR_LEN); - esp_ble_gatt_create_conn.remote_addr_type = scan_result->scan_rst.ble_addr_type; - esp_ble_gatt_create_conn.own_addr_type = BLE_ADDR_TYPE_PUBLIC; - esp_ble_gatt_create_conn.is_direct = true; - esp_ble_gatt_create_conn.is_aux = false; + esp_ble_gatt_creat_conn_params_t creat_conn_params; + memcpy(&creat_conn_params.remote_bda, scan_result->scan_rst.bda, ESP_BD_ADDR_LEN); + creat_conn_params.remote_addr_type = scan_result->scan_rst.ble_addr_type; + creat_conn_params.own_addr_type = BLE_ADDR_TYPE_PUBLIC; + creat_conn_params.is_direct = true; + creat_conn_params.is_aux = false; esp_ble_gattc_enh_open(gattc_profile_tab[GATTC_PROFILE_C_APP_ID].gattc_if, - esp_ble_gatt_create_conn); + &creat_conn_params); // Update peer gatt server address memcpy(peer_gatts_addr, scan_result->scan_rst.bda, sizeof(esp_bd_addr_t));