feat(ble/bluedroid): Support setting connection params when creating connection
This commit is contained in:
+8
-7
@@ -372,14 +372,15 @@ We are interested in the `ESP_GAP_SEARCH_INQ_RES_EVT` event, which is called eve
|
||||
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 = {0};
|
||||
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;
|
||||
creat_conn_params.phy_mask = 0x0;
|
||||
esp_ble_gattc_enh_open(gl_profile_tab[PROFILE_A_APP_ID].gattc_if,
|
||||
&esp_ble_gatt_create_conn);
|
||||
&creat_conn_params);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user