diff --git a/components/bt/host/bluedroid/api/esp_a2dp_api.c b/components/bt/host/bluedroid/api/esp_a2dp_api.c index 254c43d5a3..bff5e3b652 100644 --- a/components/bt/host/bluedroid/api/esp_a2dp_api.c +++ b/components/bt/host/bluedroid/api/esp_a2dp_api.c @@ -292,9 +292,8 @@ esp_err_t esp_a2d_media_ctrl(esp_a2d_media_ctrl_t ctrl) return ESP_ERR_INVALID_STATE; } - if (ctrl == ESP_A2D_MEDIA_CTRL_STOP) { - LOG_WARN("ESP_A2D_MEDIA_CTRL_STOP is deprecated, using ESP_A2D_MEDIA_CTRL_SUSPEND instead.\n"); - ctrl = ESP_A2D_MEDIA_CTRL_SUSPEND; + if (ctrl > ESP_A2D_MEDIA_CTRL_SUSPEND) { + return ESP_ERR_INVALID_ARG; } bt_status_t stat; diff --git a/components/bt/host/bluedroid/api/esp_bt_device.c b/components/bt/host/bluedroid/api/esp_bt_device.c index d3229e5f5c..b82f85d75e 100644 --- a/components/bt/host/bluedroid/api/esp_bt_device.c +++ b/components/bt/host/bluedroid/api/esp_bt_device.c @@ -36,44 +36,6 @@ const uint8_t *esp_bt_dev_get_address(void) return controller_get_interface()->get_address()->address; } -esp_err_t esp_bt_dev_set_device_name(const char *name) -{ - btc_msg_t msg = {0}; - btc_dev_args_t arg; - - if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) { - return ESP_ERR_INVALID_STATE; - } - if (!name){ - return ESP_ERR_INVALID_ARG; - } - if (strlen(name) > BTC_MAX_LOC_BD_NAME_LEN) { - return ESP_ERR_INVALID_ARG; - } - - msg.sig = BTC_SIG_API_CALL; - msg.pid = BTC_PID_DEV; - msg.act = BTC_DEV_ACT_SET_DEVICE_NAME; - arg.set_dev_name.device_name = (char *)name; - - return (btc_transfer_context(&msg, &arg, sizeof(btc_dev_args_t), btc_dev_call_arg_deep_copy, btc_dev_call_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL); -} - -esp_err_t esp_bt_dev_get_device_name(void) -{ - btc_msg_t msg = {0}; - - if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) { - return ESP_ERR_INVALID_STATE; - } - - msg.sig = BTC_SIG_API_CALL; - msg.pid = BTC_PID_DEV; - msg.act = BTC_DEV_ACT_GET_DEVICE_NAME; - - return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL); -} - #if (ESP_COEX_VSC_INCLUDED == TRUE) esp_err_t esp_bt_dev_coex_status_config(esp_bt_dev_coex_type_t type, esp_bt_dev_coex_op_t op, uint8_t status) { diff --git a/components/bt/host/bluedroid/api/esp_hf_ag_api.c b/components/bt/host/bluedroid/api/esp_hf_ag_api.c index af3ddb4a1c..34de9398c2 100644 --- a/components/bt/host/bluedroid/api/esp_hf_ag_api.c +++ b/components/bt/host/bluedroid/api/esp_hf_ag_api.c @@ -234,35 +234,6 @@ esp_err_t esp_hf_ag_cmee_send(esp_bd_addr_t remote_addr, esp_hf_at_response_code return (status == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL; } -esp_err_t esp_hf_ag_devices_status_indchange(esp_bd_addr_t remote_addr, - esp_hf_call_status_t call_state, - esp_hf_call_setup_status_t call_setup_state, - esp_hf_network_state_t ntk_state, int signal) -{ - if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) { - return ESP_ERR_INVALID_STATE; - } - if (signal < 0 || signal > 5) { - return ESP_ERR_INVALID_ARG; - } - btc_msg_t msg; - msg.sig = BTC_SIG_API_CALL; - msg.pid = BTC_PID_HF; - msg.act = BTC_HF_IND_NOTIFICATION_EVT; - - btc_hf_args_t arg; - memset(&arg, 0, sizeof(btc_hf_args_t)); - memcpy(&(arg.ind_change.remote_addr), remote_addr, sizeof(esp_bd_addr_t)); - arg.ind_change.call_state = call_state; - arg.ind_change.call_setup_state = call_setup_state; - arg.ind_change.ntk_state = ntk_state; - arg.ind_change.signal = signal; - - /* Switch to BTC context */ - bt_status_t state = btc_transfer_context(&msg, &arg, sizeof(btc_hf_args_t), NULL, NULL); - return (state == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL; -} - esp_err_t esp_hf_ag_ciev_report(esp_bd_addr_t remote_addr, esp_hf_ciev_report_type_t ind_type, int value) { if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) { diff --git a/components/bt/host/bluedroid/api/esp_spp_api.c b/components/bt/host/bluedroid/api/esp_spp_api.c index 5c01aeb2e5..31a18ab235 100644 --- a/components/bt/host/bluedroid/api/esp_spp_api.c +++ b/components/bt/host/bluedroid/api/esp_spp_api.c @@ -32,18 +32,6 @@ esp_err_t esp_spp_register_callback(esp_spp_cb_t callback) return ESP_OK; } - -esp_err_t esp_spp_init(esp_spp_mode_t mode) -{ - esp_spp_cfg_t bt_spp_cfg = { - .mode = mode, - .enable_l2cap_ertm = true, - .tx_buffer_size = ESP_SPP_MAX_TX_BUFFER_SIZE, - }; - - return esp_spp_enhanced_init(&bt_spp_cfg); -} - esp_err_t esp_spp_enhanced_init(const esp_spp_cfg_t *cfg) { btc_msg_t msg; diff --git a/components/bt/host/bluedroid/api/include/api/esp_a2dp_api.h b/components/bt/host/bluedroid/api/include/api/esp_a2dp_api.h index 71d3d597e9..cfff2f6646 100644 --- a/components/bt/host/bluedroid/api/include/api/esp_a2dp_api.h +++ b/components/bt/host/bluedroid/api/include/api/esp_a2dp_api.h @@ -141,11 +141,6 @@ typedef struct { #define ESP_A2D_CIE_LEN_M24 (6) #define ESP_A2D_CIE_LEN_ATRAC (7) union { - uint8_t sbc[ESP_A2D_CIE_LEN_SBC] __attribute__((deprecated)); /*!< SBC codec capabilities, deprecated, use sbc_info instead */ - uint8_t m12[ESP_A2D_CIE_LEN_M12] __attribute__((deprecated)); /*!< MPEG-1,2 audio codec capabilities, deprecated, use m12_info instead */ - uint8_t m24[ESP_A2D_CIE_LEN_M24] __attribute__((deprecated)); /*!< MPEG-2, 4 AAC audio codec capabilities, deprecated, use m24_info instead */ - uint8_t atrac[ESP_A2D_CIE_LEN_ATRAC] __attribute__((deprecated)); /*!< ATRAC family codec capabilities, deprecated, use atrac_info instead */ - esp_a2d_cie_sbc_t sbc_info; /*!< SBC codec capabilities */ esp_a2d_cie_m12_t m12_info; /*!< MPEG-1,2 audio codec capabilities */ esp_a2d_cie_m24_t m24_info; /*!< MPEG-2, 4 AAC audio codec capabilities */ @@ -177,8 +172,6 @@ typedef enum { typedef enum { ESP_A2D_AUDIO_STATE_SUSPEND = 0, /*!< audio stream datapath suspended by remote device */ ESP_A2D_AUDIO_STATE_STARTED, /*!< audio stream datapath started */ - ESP_A2D_AUDIO_STATE_STOPPED = ESP_A2D_AUDIO_STATE_SUSPEND, /*!< @note Deprecated */ - ESP_A2D_AUDIO_STATE_REMOTE_SUSPEND = ESP_A2D_AUDIO_STATE_SUSPEND, /*!< @note Deprecated */ } esp_a2d_audio_state_t; /** @@ -198,7 +191,6 @@ typedef enum { ESP_A2D_MEDIA_CTRL_CHECK_SRC_RDY, /*!< check whether AVDTP is connected, only used in A2DP source */ ESP_A2D_MEDIA_CTRL_START, /*!< command to set up media transmission channel */ ESP_A2D_MEDIA_CTRL_SUSPEND, /*!< command to suspend media transmission */ - ESP_A2D_MEDIA_CTRL_STOP, /*!< @note Deprecated, Please use ESP_A2D_MEDIA_CTRL_SUSPEND */ } esp_a2d_media_ctrl_t; /** diff --git a/components/bt/host/bluedroid/api/include/api/esp_a2dp_legacy_api.h b/components/bt/host/bluedroid/api/include/api/esp_a2dp_legacy_api.h index 2e59d05806..a3ddd03a31 100644 --- a/components/bt/host/bluedroid/api/include/api/esp_a2dp_legacy_api.h +++ b/components/bt/host/bluedroid/api/include/api/esp_a2dp_legacy_api.h @@ -18,7 +18,7 @@ extern "C" { #endif /** - * @brief [Deprecated] A2DP sink data callback function + * @brief A2DP sink data callback function * * @param[in] buf : pointer to the data received from A2DP source device and is PCM format decoded from SBC decoder; * buf references to a static memory block and can be overwritten by upcoming data @@ -28,7 +28,7 @@ extern "C" { typedef void (* esp_a2d_sink_data_cb_t)(const uint8_t *buf, uint32_t len); /** - * @brief [Deprecated] A2DP source data read callback function + * @brief A2DP source data read callback function * * @param[in] buf : buffer to be filled with PCM data stream from higher layer * @@ -41,7 +41,7 @@ typedef void (* esp_a2d_sink_data_cb_t)(const uint8_t *buf, uint32_t len); typedef int32_t (* esp_a2d_source_data_cb_t)(uint8_t *buf, int32_t len); /** - * @brief [Deprecated] Register A2DP sink data output function; For now the output is PCM data stream decoded + * @brief Register A2DP sink data output function; For now the output is PCM data stream decoded * from SBC format. This function should be called only after esp_bluedroid_enable() * completes successfully, used only by A2DP sink. The callback is invoked in the context * of A2DP sink task whose stack size is configurable through menuconfig. @@ -57,7 +57,7 @@ typedef int32_t (* esp_a2d_source_data_cb_t)(uint8_t *buf, int32_t len); esp_err_t esp_a2d_sink_register_data_callback(esp_a2d_sink_data_cb_t callback); /** - * @brief [Deprecated] Register A2DP source data input function. For now, the input should be PCM data stream. + * @brief Register A2DP source data input function. For now, the input should be PCM data stream. * This function should be called only after esp_bluedroid_enable() completes * successfully. The callback is invoked in the context of A2DP source task whose * stack size is configurable through menuconfig. diff --git a/components/bt/host/bluedroid/api/include/api/esp_bt_device.h b/components/bt/host/bluedroid/api/include/api/esp_bt_device.h index 60758f1e59..38d182e882 100644 --- a/components/bt/host/bluedroid/api/include/api/esp_bt_device.h +++ b/components/bt/host/bluedroid/api/include/api/esp_bt_device.h @@ -80,38 +80,6 @@ esp_err_t esp_bt_dev_register_callback(esp_bt_dev_cb_t callback); */ const uint8_t *esp_bt_dev_get_address(void); - -/** - * @brief Set bluetooth device name. This function should be called after esp_bluedroid_enable() - * completes successfully. - * - * A BR/EDR/LE device type shall have a single Bluetooth device name which shall be - * identical irrespective of the physical channel used to perform the name discovery procedure. - * - * @param[in] name : device name to be set - * - * @return - * - ESP_OK : Succeed - * - ESP_ERR_INVALID_ARG : if name is NULL pointer or empty, or string length out of limit - * - ESP_ERR_INVALID_STATE : if bluetooth stack is not yet enabled - * - ESP_FAIL : others - */ -esp_err_t esp_bt_dev_set_device_name(const char *name) __attribute__((deprecated("Please use esp_bt_gap_set_device_name or esp_ble_gap_set_device_name"))); - -/** - * @brief Get bluetooth device name. This function should be called after esp_bluedroid_enable() - * completes successfully. - * - * A BR/EDR/LE device type shall have a single Bluetooth device name which shall be - * identical irrespective of the physical channel used to perform the name discovery procedure. - * - * @return - * - ESP_OK : Succeed - * - ESP_ERR_INVALID_STATE : if bluetooth stack is not yet enabled - * - ESP_FAIL : others - */ -esp_err_t esp_bt_dev_get_device_name(void) __attribute__((deprecated("Please use esp_bt_gap_get_device_name or esp_ble_gap_get_device_name"))); - /** * @brief Config bluetooth device coexis status. This function should be called after esp_bluedroid_enable() * completes successfully. @@ -141,7 +109,7 @@ esp_err_t esp_bt_config_file_path_get(char *file_path); /** * @brief This function is used to update the path name of bluetooth bond keys saved in the NVS module - * and need to be called before esp_bluedroid_init(). + * and need to be called before esp_bluedroid_init_with_cfg(). * @param[in] file_path: the name of config file path, the length of file_path should be less than NVS_NS_NAME_MAX_SIZE * * @return diff --git a/components/bt/host/bluedroid/api/include/api/esp_bt_main.h b/components/bt/host/bluedroid/api/include/api/esp_bt_main.h index b9b60e3dbd..f0f10afdd7 100644 --- a/components/bt/host/bluedroid/api/include/api/esp_bt_main.h +++ b/components/bt/host/bluedroid/api/include/api/esp_bt_main.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -48,7 +48,7 @@ typedef struct { esp_bluedroid_status_t esp_bluedroid_get_status(void); /** - * @brief Enable bluetooth, must after esp_bluedroid_init()/esp_bluedroid_init_with_cfg(). + * @brief Enable bluetooth, must after esp_bluedroid_init_with_cfg(). * * @return * - ESP_OK : Succeed diff --git a/components/bt/host/bluedroid/api/include/api/esp_hf_ag_api.h b/components/bt/host/bluedroid/api/include/api/esp_hf_ag_api.h index f34c52c42d..f1dff01a93 100644 --- a/components/bt/host/bluedroid/api/include/api/esp_hf_ag_api.h +++ b/components/bt/host/bluedroid/api/include/api/esp_hf_ag_api.h @@ -441,29 +441,6 @@ esp_err_t esp_hf_ag_unknown_at_send(esp_bd_addr_t remote_addr, char *unat); */ esp_err_t esp_hf_ag_cmee_send(esp_bd_addr_t remote_bda, esp_hf_at_response_code_t response_code, esp_hf_cme_err_t error_code); -/** - * - * @brief Unsolicited send device status notification to HFP Client. - * As a precondition to use this API, Service Level Connection shall exist with HFP client. - * - * @param[in] remote_addr: remote bluetooth device address - * @param[in] call_state: call state - * @param[in] call_setup_state: call setup state - * @param[in] ntk_state: network service state - * @param[in] signal: signal strength from 0 to 5 - * @return - * - ESP_OK: device status notification is sent to lower layer - * - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled - * - ESP_ERR_INVALID_ARG: if arguments are invalid - * - ESP_FAIL: others - * - */ -esp_err_t esp_hf_ag_devices_status_indchange(esp_bd_addr_t remote_addr, esp_hf_call_status_t call_state, - esp_hf_call_setup_status_t call_setup_state, - esp_hf_network_state_t ntk_state, int signal) __attribute__(( - deprecated("Please use esp_hf_ag_ciev_report") - )); - /** * * @brief Send indicator report "+CIEV: " to HFP Client. "CIEV" means “indicator events reporting", diff --git a/components/bt/host/bluedroid/api/include/api/esp_hidd_api.h b/components/bt/host/bluedroid/api/include/api/esp_hidd_api.h index f16bbcb0fa..3c136ef069 100644 --- a/components/bt/host/bluedroid/api/include/api/esp_hidd_api.h +++ b/components/bt/host/bluedroid/api/include/api/esp_hidd_api.h @@ -288,7 +288,7 @@ esp_err_t esp_bt_hid_device_register_callback(esp_hd_cb_t callback); /** * @brief Initializes HIDD interface. This function should be called after - * esp_bluedroid_init()/esp_bluedroid_init_with_cfg() and esp_bluedroid_enable() success, and should be + * esp_bluedroid_init_with_cfg() and esp_bluedroid_enable() success, and should be * called after esp_bt_hid_device_register_callback. When the operation is complete, the callback * function will be called with ESP_HIDD_INIT_EVT. * @@ -300,7 +300,7 @@ esp_err_t esp_bt_hid_device_init(void); /** * @brief De-initializes HIDD interface. This function should be called after - * esp_bluedroid_init()/esp_bluedroid_init_with_cfg() and esp_bluedroid_enable() success, and should be + * esp_bluedroid_init_with_cfg() and esp_bluedroid_enable() success, and should be * called after esp_bt_hid_device_init(). When the operation is complete, the callback function will be * called with ESP_HIDD_DEINIT_EVT. * @@ -312,7 +312,7 @@ esp_err_t esp_bt_hid_device_deinit(void); /** * @brief Registers HIDD parameters with SDP and sets l2cap Quality of Service. This function should be - * called after esp_bluedroid_init()/esp_bluedroid_init_with_cfg() and esp_bluedroid_enable() success, + * called after esp_bluedroid_init_with_cfg() and esp_bluedroid_enable() success, * and should be called after esp_bt_hid_device_init(). When the operation is complete, the callback * function will be called with ESP_HIDD_REGISTER_APP_EVT. * @@ -329,7 +329,7 @@ esp_err_t esp_bt_hid_device_register_app(esp_hidd_app_param_t *app_param, esp_hi /** * @brief Removes HIDD parameters from SDP and resets l2cap Quality of Service. This function should be - * called after esp_bluedroid_init()/esp_bluedroid_init_with_cfg() and esp_bluedroid_enable() success, + * called after esp_bluedroid_init_with_cfg() and esp_bluedroid_enable() success, * and should be called after esp_bt_hid_device_init(). When the operation is complete, the callback * function will be called with ESP_HIDD_UNREGISTER_APP_EVT. * @@ -341,7 +341,7 @@ esp_err_t esp_bt_hid_device_unregister_app(void); /** * @brief Connects to the peer HID Host with virtual cable. This function should be called after - * esp_bluedroid_init()/esp_bluedroid_init_with_cfg() and esp_bluedroid_enable() success, and should be + * esp_bluedroid_init_with_cfg() and esp_bluedroid_enable() success, and should be * called after esp_bt_hid_device_init(). When the operation is complete, the callback function will * be called with ESP_HIDD_OPEN_EVT. * @@ -360,7 +360,7 @@ esp_err_t esp_bt_hid_device_connect(esp_bd_addr_t bd_addr); /** * @brief Disconnects from the currently connected HID Host. This function should be called after - * esp_bluedroid_init()/esp_bluedroid_init_with_cfg() and esp_bluedroid_enable() success, and should be + * esp_bluedroid_init_with_cfg() and esp_bluedroid_enable() success, and should be * called after esp_bt_hid_device_init(). When the operation is complete, the callback function will * be called with ESP_HIDD_CLOSE_EVT. * @@ -375,7 +375,7 @@ esp_err_t esp_bt_hid_device_disconnect(void); /** * @brief Sends HID report to the currently connected HID Host. This function should be called after - * esp_bluedroid_init()/esp_bluedroid_init_with_cfg() and esp_bluedroid_enable() success, and should be + * esp_bluedroid_init_with_cfg() and esp_bluedroid_enable() success, and should be * called after esp_bt_hid_device_init(). When the operation is complete, the callback function will * be called with ESP_HIDD_SEND_REPORT_EVT. * @@ -392,7 +392,7 @@ esp_err_t esp_bt_hid_device_send_report(esp_hidd_report_type_t type, uint8_t id, /** * @brief Sends HID Handshake with error info for invalid set_report to the currently connected HID Host. - * This function should be called after esp_bluedroid_init()/esp_bluedroid_init_with_cfg() and + * This function should be called after esp_bluedroid_init_with_cfg() and * esp_bluedroid_enable() success, and should be called after esp_bt_hid_device_init(). When the * operation is complete, the callback function will be called with ESP_HIDD_REPORT_ERR_EVT. * @@ -406,7 +406,7 @@ esp_err_t esp_bt_hid_device_report_error(esp_hidd_handshake_error_t error); /** * @brief Remove the virtually cabled device. This function should be called after - * esp_bluedroid_init()/esp_bluedroid_init_with_cfg() and esp_bluedroid_enable() success, and should be + * esp_bluedroid_init_with_cfg() and esp_bluedroid_enable() success, and should be * called after esp_bt_hid_device_init(). When the operation is complete, the callback function will be * called with ESP_HIDD_VC_UNPLUG_EVT. * diff --git a/components/bt/host/bluedroid/api/include/api/esp_hidh_api.h b/components/bt/host/bluedroid/api/include/api/esp_hidh_api.h index 51a0d43f7b..a3494edc42 100644 --- a/components/bt/host/bluedroid/api/include/api/esp_hidh_api.h +++ b/components/bt/host/bluedroid/api/include/api/esp_hidh_api.h @@ -327,7 +327,7 @@ esp_err_t esp_bt_hid_host_register_callback(esp_hh_cb_t callback); /** * @brief This function initializes HID host. This function should be called after esp_bluedroid_enable() and - * esp_bluedroid_init()/esp_bluedroid_init_with_cfg() success, and should be called after + * esp_bluedroid_init_with_cfg() success, and should be called after * esp_bt_hid_host_register_callback(). When the operation is complete the callback function will be called * with ESP_HIDH_INIT_EVT. * @@ -339,7 +339,7 @@ esp_err_t esp_bt_hid_host_init(void); /** * @brief Closes the interface. This function should be called after esp_bluedroid_enable() and - * esp_bluedroid_init()/esp_bluedroid_init_with_cfg() success, and should be called after esp_bt_hid_host_init(). + * esp_bluedroid_init_with_cfg() success, and should be called after esp_bt_hid_host_init(). * When the operation is complete the callback function will be called with ESP_HIDH_DEINIT_EVT. * * @return - ESP_OK: success diff --git a/components/bt/host/bluedroid/api/include/api/esp_sdp_api.h b/components/bt/host/bluedroid/api/include/api/esp_sdp_api.h index 5c74851f31..6f33fe3df1 100644 --- a/components/bt/host/bluedroid/api/include/api/esp_sdp_api.h +++ b/components/bt/host/bluedroid/api/include/api/esp_sdp_api.h @@ -83,8 +83,6 @@ typedef struct bluetooth_sdp_hdr_overlay { int32_t profile_version; /*!< Profile version */ int user1_ptr_len; /*!< User data1 length, only used for searching RAW record */ uint8_t *user1_ptr; /*!< User data1 pointer to the raw SDP response data, only used for searching RAW record */ - int user2_ptr_len __attribute__((deprecated)); /*!< User data2 length, only used for searching RAW record */ - uint8_t *user2_ptr __attribute__((deprecated)); /*!< User data2 pointer, only used for searching RAW record */ } esp_bluetooth_sdp_hdr_overlay_t; /** diff --git a/components/bt/host/bluedroid/api/include/api/esp_spp_api.h b/components/bt/host/bluedroid/api/include/api/esp_spp_api.h index 40788667c0..f47e0c1185 100644 --- a/components/bt/host/bluedroid/api/include/api/esp_spp_api.h +++ b/components/bt/host/bluedroid/api/include/api/esp_spp_api.h @@ -262,20 +262,6 @@ typedef void (*esp_spp_cb_t)(esp_spp_cb_event_t event, esp_spp_cb_param_t *param */ esp_err_t esp_spp_register_callback(esp_spp_cb_t callback); -/** - * @brief This function is called to init SPP module. - * When the operation is completed, the callback function will be called with ESP_SPP_INIT_EVT. - * This function should be called after esp_bluedroid_enable() completes successfully. - * - * @param[in] mode: Choose the mode of SPP, ESP_SPP_MODE_CB or ESP_SPP_MODE_VFS. - * - * @return - * - ESP_OK: success - * - other: failed - */ -esp_err_t esp_spp_init(esp_spp_mode_t mode) __attribute__((deprecated("Please use esp_spp_enhanced_init"))); - - /** * @brief This function is called to init SPP module. * When the operation is completed, the callback function will be called with ESP_SPP_INIT_EVT. @@ -297,7 +283,7 @@ esp_err_t esp_spp_enhanced_init(const esp_spp_cfg_t *cfg); * The operation will close all active SPP connection first, then the callback function will be called * with ESP_SPP_CLOSE_EVT, and the number of ESP_SPP_CLOSE_EVT is equal to the number of connection. * When the operation is completed, the callback function will be called with ESP_SPP_UNINIT_EVT. - * This function should be called after esp_spp_init()/esp_spp_enhanced_init() completes successfully. + * This function should be called after esp_spp_enhanced_init() completes successfully. * * @return * - ESP_OK: success @@ -309,7 +295,7 @@ esp_err_t esp_spp_deinit(void); /** * @brief This function is called to performs service discovery for the services provided by the given peer device. * When the operation is completed, the callback function will be called with ESP_SPP_DISCOVERY_COMP_EVT. - * This function must be called after esp_spp_init()/esp_spp_enhanced_init() successful and before esp_spp_deinit(). + * This function must be called after esp_spp_enhanced_init() successful and before esp_spp_deinit(). * * @param[in] bd_addr: Remote device bluetooth device address. * @@ -323,7 +309,7 @@ esp_err_t esp_spp_start_discovery(esp_bd_addr_t bd_addr); * @brief This function makes an SPP connection to a remote BD Address. * When the connection is initiated or failed to initiate, the callback is called with ESP_SPP_CL_INIT_EVT. * When the connection is established or failed, the callback is called with ESP_SPP_OPEN_EVT. - * This function must be called after esp_spp_init()/esp_spp_enhanced_init() successful and before esp_spp_deinit(). + * This function must be called after esp_spp_enhanced_init() successful and before esp_spp_deinit(). * * @param[in] sec_mask: Security Setting Mask. Suggest to use ESP_SPP_SEC_NONE, ESP_SPP_SEC_AUTHORIZE or ESP_SPP_SEC_AUTHENTICATE only. * @param[in] role: Master or slave. @@ -339,7 +325,7 @@ esp_err_t esp_spp_connect(esp_spp_sec_t sec_mask, esp_spp_role_t role, uint8_t r /** * @brief This function closes an SPP connection. * When the operation is completed, the callback function will be called with ESP_SPP_CLOSE_EVT. - * This function must be called after esp_spp_init()/esp_spp_enhanced_init() successful and before esp_spp_deinit(). + * This function must be called after esp_spp_enhanced_init() successful and before esp_spp_deinit(). * * @param[in] handle: The connection handle. * @@ -354,7 +340,7 @@ esp_err_t esp_spp_disconnect(uint32_t handle); * SPP connection request from a remote Bluetooth device. * When the server is started successfully, the callback is called with ESP_SPP_START_EVT. * When the connection is established, the callback is called with ESP_SPP_SRV_OPEN_EVT. - * This function must be called after esp_spp_init()/esp_spp_enhanced_init() successful and before esp_spp_deinit(). + * This function must be called after esp_spp_enhanced_init() successful and before esp_spp_deinit(). * * @param[in] sec_mask: Security Setting Mask. Suggest to use ESP_SPP_SEC_NONE, ESP_SPP_SEC_AUTHORIZE or ESP_SPP_SEC_AUTHENTICATE only. * @param[in] role: Master or slave. @@ -373,7 +359,7 @@ esp_err_t esp_spp_start_srv(esp_spp_sec_t sec_mask, esp_spp_role_t role, uint8_t * The operation will close all active SPP connection first, then the callback function will be called * with ESP_SPP_CLOSE_EVT, and the number of ESP_SPP_CLOSE_EVT is equal to the number of connection. * When the operation is completed, the callback is called with ESP_SPP_SRV_STOP_EVT. - * This function must be called after esp_spp_init()/esp_spp_enhanced_init() successful and before esp_spp_deinit(). + * This function must be called after esp_spp_enhanced_init() successful and before esp_spp_deinit(). * * @return * - ESP_OK: success @@ -387,7 +373,7 @@ esp_err_t esp_spp_stop_srv(void); * The operation will close all active SPP connection first on the specific SPP server, then the callback function will be called * with ESP_SPP_CLOSE_EVT, and the number of ESP_SPP_CLOSE_EVT is equal to the number of connection. * When the operation is completed, the callback is called with ESP_SPP_SRV_STOP_EVT. - * This function must be called after esp_spp_init()/esp_spp_enhanced_init() successful and before esp_spp_deinit(). + * This function must be called after esp_spp_enhanced_init() successful and before esp_spp_deinit(). * * @param[in] scn: Server channel number. * @@ -420,7 +406,7 @@ esp_err_t esp_spp_write(uint32_t handle, int len, uint8_t *p_data); * @brief This function is used to register VFS. * For now, SPP only supports write, read and close. * When the operation is completed, the callback function will be called with ESP_SPP_VFS_REGISTER_EVT. - * This function must be called after esp_spp_init()/esp_spp_enhanced_init() successful and before esp_spp_deinit(). + * This function must be called after esp_spp_enhanced_init() successful and before esp_spp_deinit(). * * @return * - ESP_OK: success diff --git a/components/bt/host/bluedroid/btc/core/btc_dev.c b/components/bt/host/bluedroid/btc/core/btc_dev.c index 18cda3e0d8..a9d384683c 100644 --- a/components/bt/host/bluedroid/btc/core/btc_dev.c +++ b/components/bt/host/bluedroid/btc/core/btc_dev.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -21,40 +21,11 @@ static inline void btc_dev_cb_to_app(esp_bt_dev_cb_event_t event, esp_bt_dev_cb_ } } -static void btc_dev_get_dev_name_callback(UINT8 status, char *name) -{ - esp_bt_dev_cb_param_t param; - bt_status_t ret; - btc_msg_t msg = {0}; - - memset(¶m, 0, sizeof(esp_bt_dev_cb_param_t)); - - msg.sig = BTC_SIG_API_CB; - msg.pid = BTC_PID_DEV; - msg.act = ESP_BT_DEV_NAME_RES_EVT; - - param.name_res.status = btc_btm_status_to_esp_status(status); - param.name_res.name = name; - - ret = btc_transfer_context(&msg, ¶m, sizeof(esp_bt_dev_cb_param_t), btc_dev_cb_arg_deep_copy, btc_dev_cb_arg_deep_free); - if (ret != BT_STATUS_SUCCESS) { - BTC_TRACE_ERROR("%s btc_transfer_context failed\n", __func__); - } -} - void btc_dev_call_arg_deep_free(btc_msg_t *msg) { BTC_TRACE_DEBUG("%s \n", __func__); - btc_dev_args_t *arg = (btc_dev_args_t *)msg->arg; switch (msg->act) { - case BTC_DEV_ACT_SET_DEVICE_NAME:{ - if (arg->set_dev_name.device_name) { - osi_free(arg->set_dev_name.device_name); - } - break; - } - case BTC_DEV_ACT_GET_DEVICE_NAME: #if (ESP_COEX_VSC_INCLUDED == TRUE) case BTC_DEV_ACT_CFG_COEX_STATUS: #endif @@ -68,21 +39,10 @@ void btc_dev_call_arg_deep_free(btc_msg_t *msg) void btc_dev_call_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src) { BTC_TRACE_DEBUG("%s \n", __func__); - btc_dev_args_t *dst = (btc_dev_args_t *)p_dest; - btc_dev_args_t *src = (btc_dev_args_t *)p_src; + UNUSED(p_dest); + UNUSED(p_src); switch (msg->act) { - case BTC_DEV_ACT_SET_DEVICE_NAME:{ - dst->set_dev_name.device_name = (char *)osi_malloc((BTC_MAX_LOC_BD_NAME_LEN + 1) * sizeof(char)); - if (dst->set_dev_name.device_name) { - BCM_STRNCPY_S(dst->set_dev_name.device_name, src->set_dev_name.device_name, BTC_MAX_LOC_BD_NAME_LEN); - dst->set_dev_name.device_name[BTC_MAX_LOC_BD_NAME_LEN] = '\0'; - } else { - BTC_TRACE_ERROR("%s %d no mem\n",__func__, msg->act); - } - break; - } - case BTC_DEV_ACT_GET_DEVICE_NAME: #if (ESP_COEX_VSC_INCLUDED == TRUE) case BTC_DEV_ACT_CFG_COEX_STATUS: #endif @@ -96,7 +56,7 @@ void btc_dev_call_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src) void btc_dev_cb_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src) { esp_bt_dev_cb_param_t *src = (esp_bt_dev_cb_param_t *)p_src; - esp_bt_dev_cb_param_t *dst = (esp_bt_dev_cb_param_t *) p_dest; + esp_bt_dev_cb_param_t *dst = (esp_bt_dev_cb_param_t *) p_dest; switch (msg->act) { case ESP_BT_DEV_NAME_RES_EVT:{ @@ -135,19 +95,12 @@ void btc_dev_cb_arg_deep_free(btc_msg_t *msg) void btc_dev_call_handler(btc_msg_t *msg) { - btc_dev_args_t *arg = (btc_dev_args_t *)msg->arg; - BTC_TRACE_DEBUG("%s act %d\n", __FUNCTION__, msg->act); switch (msg->act) { - case BTC_DEV_ACT_SET_DEVICE_NAME: - BTA_DmSetDeviceName(arg->set_dev_name.device_name, BT_DEVICE_TYPE_DUMO); - break; - case BTC_DEV_ACT_GET_DEVICE_NAME: - BTA_DmGetDeviceName(btc_dev_get_dev_name_callback, BT_DEVICE_TYPE_DUMO); - break; #if (ESP_COEX_VSC_INCLUDED == TRUE) case BTC_DEV_ACT_CFG_COEX_STATUS: + btc_dev_args_t *arg = (btc_dev_args_t *)msg->arg; BTA_DmCfgCoexStatus(arg->cfg_coex_status.op, arg->cfg_coex_status.type, arg->cfg_coex_status.status); diff --git a/components/bt/host/bluedroid/btc/include/btc/btc_dev.h b/components/bt/host/bluedroid/btc/include/btc/btc_dev.h index f213309c53..c96bc38bab 100644 --- a/components/bt/host/bluedroid/btc/include/btc/btc_dev.h +++ b/components/bt/host/bluedroid/btc/include/btc/btc_dev.h @@ -12,11 +12,7 @@ #include "btc/btc_task.h" typedef enum { - BTC_DEV_ACT_SET_DEVICE_NAME, - BTC_DEV_ACT_GET_DEVICE_NAME, -#if (ESP_COEX_VSC_INCLUDED == TRUE) BTC_DEV_ACT_CFG_COEX_STATUS, -#endif } btc_dev_act_t; /* btc_dev_args_t */ diff --git a/components/bt/host/bluedroid/btc/profile/std/hf_ag/btc_hf_ag.c b/components/bt/host/bluedroid/btc/profile/std/hf_ag/btc_hf_ag.c index 0e4947ee41..8058a0c7be 100644 --- a/components/bt/host/bluedroid/btc/profile/std/hf_ag/btc_hf_ag.c +++ b/components/bt/host/bluedroid/btc/profile/std/hf_ag/btc_hf_ag.c @@ -572,26 +572,6 @@ static bt_status_t btc_hf_cmee_response(bt_bdaddr_t *bd_addr, esp_hf_at_response return BT_STATUS_FAIL; } -// +CIEV<...> for device status update -static bt_status_t btc_hf_indchange_notification(bt_bdaddr_t *bd_addr, - esp_hf_call_status_t call_state, - esp_hf_call_setup_status_t call_setup_state, - esp_hf_network_state_t ntk_state, int signal) -{ - int idx = btc_hf_idx_by_bdaddr(bd_addr); - CHECK_HF_INIT(idx); - if (is_connected(idx, bd_addr)) { - /* Send all indicators to BTA. - * BTA will make sure no duplicates are sent out*/ - send_indicator_update(BTA_AG_IND_CALL, call_state); - send_indicator_update(BTA_AG_IND_CALLSETUP, call_setup_state); - send_indicator_update(BTA_AG_IND_SERVICE, ntk_state); - send_indicator_update(BTA_AG_IND_SIGNAL, signal); - return BT_STATUS_SUCCESS; - } - return BT_STATUS_FAIL; -} - // +CIEV<...> for device status update, send other indicators, e.g. roaming, battery, call held and bearer bt_status_t btc_hf_ciev_report(bt_bdaddr_t *bd_addr, tBTA_AG_IND_TYPE indicator, uint16_t value) { @@ -1200,14 +1180,6 @@ void btc_hf_call_handler(btc_msg_t *msg) break; } - case BTC_HF_IND_NOTIFICATION_EVT: - { - btc_hf_indchange_notification(&arg->ind_change.remote_addr, - arg->ind_change.call_state, arg->ind_change.call_setup_state, - arg->ind_change.ntk_state, arg->ind_change.signal); - break; - } - case BTC_HF_CIEV_REPORT_EVT: { btc_hf_ciev_report(&arg->ciev_rep.remote_addr, arg->ciev_rep.ind.type, arg->ciev_rep.ind.value); diff --git a/components/bt/host/bluedroid/btc/profile/std/include/bt_sdp.h b/components/bt/host/bluedroid/btc/profile/std/include/bt_sdp.h index 69fac9d6cb..e8be938b3e 100644 --- a/components/bt/host/bluedroid/btc/profile/std/include/bt_sdp.h +++ b/components/bt/host/bluedroid/btc/profile/std/include/bt_sdp.h @@ -52,8 +52,6 @@ typedef struct _bluetooth_sdp_hdr_overlay { int32_t profile_version; int user1_ptr_len; uint8_t *user1_ptr; - int user2_ptr_len; // not used - uint8_t *user2_ptr; // not used } bluetooth_sdp_hdr_overlay; typedef struct _bluetooth_sdp_raw_record { diff --git a/components/bt/host/bluedroid/btc/profile/std/include/btc_hf_ag.h b/components/bt/host/bluedroid/btc/profile/std/include/btc_hf_ag.h index 763b631411..8a11f5b9fa 100644 --- a/components/bt/host/bluedroid/btc/profile/std/include/btc_hf_ag.h +++ b/components/bt/host/bluedroid/btc/profile/std/include/btc_hf_ag.h @@ -43,7 +43,6 @@ typedef enum //AT_RESPONSE BTC_HF_UNAT_RESPONSE_EVT, BTC_HF_CME_ERR_EVT, - BTC_HF_IND_NOTIFICATION_EVT, BTC_HF_CIEV_REPORT_EVT, BTC_HF_CIND_RESPONSE_EVT, BTC_HF_COPS_RESPONSE_EVT, @@ -102,15 +101,6 @@ typedef union esp_hf_cme_err_t error_code; } ext_at; - // BTC_HF_IND_NOTIFICATION_EVT - struct indchange_status { - bt_bdaddr_t remote_addr; - esp_hf_call_status_t call_state; - esp_hf_call_setup_status_t call_setup_state; - esp_hf_network_state_t ntk_state; - int signal; - } ind_change; - //BTC_HF_CIEV_REPORT_EVT struct ciev_args { bt_bdaddr_t remote_addr; diff --git a/components/protocomm/src/simple_ble/simple_ble.c b/components/protocomm/src/simple_ble/simple_ble.c index 370cc91d44..bf292da635 100644 --- a/components/protocomm/src/simple_ble/simple_ble.c +++ b/components/protocomm/src/simple_ble/simple_ble.c @@ -256,7 +256,8 @@ esp_err_t simple_ble_start(simple_ble_cfg_t *cfg) } #endif - ret = esp_bluedroid_init(); + esp_bluedroid_config_t bluedroid_cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&bluedroid_cfg); if (ret) { ESP_LOGE(TAG, "%s init bluetooth failed %d", __func__, ret); return ret; diff --git a/docs/en/migration-guides/release-6.x/6.0/bluetooth-classic.rst b/docs/en/migration-guides/release-6.x/6.0/bluetooth-classic.rst new file mode 100644 index 0000000000..c4e2cfce20 --- /dev/null +++ b/docs/en/migration-guides/release-6.x/6.0/bluetooth-classic.rst @@ -0,0 +1,44 @@ +Bluetooth Classic +================= + +:link_to_translation:`zh_CN:[中文]` + +Bluedroid +--------- + + The following Bluedroid API have been deprecated and removed: + + - :component_file:`/bt/host/bluedroid/api/include/api/esp_bt_device.h` + + - Remove ``esp_err_t esp_bt_dev_set_device_name(const char *name)`` + + - Set device name API has been replaced by ``esp_err_t esp_bt_gap_set_device_name(const char *name)`` or ``esp_err_t esp_ble_gap_set_device_name(const char *name)``. The original function has been deprecated. + + - Remove ``esp_err_t esp_bt_dev_get_device_name(void)`` + + - Get device name API has been replaced by ``esp_err_t esp_bt_gap_get_device_name(void)`` or ``esp_err_t esp_ble_gap_get_device_name(void)``. The original function has been deprecated. + + - :component_file:`/bt/host/bluedroid/api/include/api/esp_spp_api.h` + + - Remove ``esp_err_t esp_spp_init(esp_spp_mode_t mode)`` + + - SPP init API has been replaced by ``esp_err_t esp_spp_enhanced_init(const esp_spp_cfg_t *cfg)``. + - A new configuration structure ``esp_spp_cfg_t`` has been introduced as a parameter for ``esp_spp_enhanced_init``. + + - :component_file:`/bt/host/bluedroid/api/include/api/esp_hf_ag_api.h` + + - Remove ``esp_err_t esp_hf_ag_devices_status_indchange(...)`` + + - Sending indicator reports to the HFP client API has been replaced by ``esp_hf_ag_ciev_report(...)``. + + The following Bluedroid API have been changed: + + - :component_file:`/bt/host/bluedroid/api/include/api/esp_sdp_api.h` + + - Field ``user2_ptr_len`` and ``user2_ptr`` is removed in structure ``esp_bluetooth_sdp_hdr_overlay_t``, since they are not used in SDP record creation or searching. + + - :component_file:`/bt/host/bluedroid/api/include/api/esp_a2dp_api.h` + + - Field ``ESP_A2D_MEDIA_CTRL_STOP`` is removed in structure ``esp_a2d_media_ctrl_t``, and is replaced by ``ESP_A2D_MEDIA_CTRL_SUSPEND``. + + - Field ``sbc, m12, m24 and atrac`` is removed and replaced by ``sbc_info, m12_info, m24_info and atrc_info`` in structure ``esp_a2d_mcc_t``. diff --git a/docs/en/migration-guides/release-6.x/6.0/index.rst b/docs/en/migration-guides/release-6.x/6.0/index.rst index d999d6676d..16eb84f5a3 100644 --- a/docs/en/migration-guides/release-6.x/6.0/index.rst +++ b/docs/en/migration-guides/release-6.x/6.0/index.rst @@ -6,6 +6,7 @@ Migration from 5.5 to 6.0 .. toctree:: :maxdepth: 1 + bluetooth-classic build-system peripherals provisioning diff --git a/docs/zh_CN/migration-guides/release-6.x/6.0/bluetooth-classic.rst b/docs/zh_CN/migration-guides/release-6.x/6.0/bluetooth-classic.rst new file mode 100644 index 0000000000..9eb79b80f6 --- /dev/null +++ b/docs/zh_CN/migration-guides/release-6.x/6.0/bluetooth-classic.rst @@ -0,0 +1,45 @@ +Bluetooth Classic +================= + +:link_to_translation:`en:[English]` + +Bluedroid +--------- + + 以下 Bluedroid API 已被废弃并移除 + + - :component_file:`/bt/host/bluedroid/api/include/api/esp_bt_device.h` + + - 移除 ``esp_err_t esp_bt_dev_set_device_name(const char *name)`` + + - 设置设备名 API 已被替换为 ``esp_err_t esp_bt_gap_set_device_name(const char *name)`` or ``esp_err_t esp_ble_gap_set_device_name(const char *name)``。 + + - 移除 ``esp_err_t esp_bt_dev_get_device_name(void)`` + + - 获取设备名 API 已被替换为 ``esp_err_t esp_bt_gap_get_device_name(void)`` or ``esp_err_t esp_ble_gap_get_device_name(void)``。 + + - :component_file:`/bt/host/bluedroid/api/include/api/esp_spp_api.h` + + - 移除 ``esp_err_t esp_spp_init(esp_spp_mode_t mode)`` + + - SPP 初始化 API 已被替代为 ``esp_err_t esp_spp_enhanced_init(const esp_spp_cfg_t *cfg)``。 + - 新增配置结构体 ``esp_spp_cfg_t`` 作为 ``esp_spp_enhanced_init`` 的参数引入。 + + - :component_file:`/bt/host/bluedroid/api/include/api/esp_hf_ag_api.h` + + - 移除 ``esp_err_t esp_hf_ag_devices_status_indchange(...)`` + + - 向 HFP 客户端发送指标报告 API 已被替换为 ``esp_hf_ag_ciev_report(...)``。 + + 以下 Bluedroid API 发生变更 + + - :component_file:`/bt/host/bluedroid/api/include/api/esp_sdp_api.h` + + - 结构体 ``esp_bluetooth_sdp_hdr_overlay_t`` 中的字段 ``user2_ptr_len`` 和 ``user2_ptr`` 被移除,因为 SDP 的 API 或者事件中不会用到该字段。 + + - :component_file:`/bt/host/bluedroid/api/include/api/esp_a2dp_api.h` + + - 结构体 ``esp_a2d_media_ctrl_t`` 中的字段 ``ESP_A2D_MEDIA_CTRL_STOP`` 被移除,该字段被 ``ESP_A2D_MEDIA_CTRL_SUSPEND`` 替代。 + + - 结构体 ``esp_a2d_mcc_t`` 中的字段 ``sbc, m12, m24, atrac`` 被移除并由字段 ``bc_info, m12_info, m24_info , atrc_info`` 替代。 + diff --git a/docs/zh_CN/migration-guides/release-6.x/6.0/index.rst b/docs/zh_CN/migration-guides/release-6.x/6.0/index.rst index 0f1c9010e6..81b1fdf27a 100644 --- a/docs/zh_CN/migration-guides/release-6.x/6.0/index.rst +++ b/docs/zh_CN/migration-guides/release-6.x/6.0/index.rst @@ -6,6 +6,7 @@ .. toctree:: :maxdepth: 1 + bluetooth-classic build-system peripherals provisioning diff --git a/examples/bluetooth/ble_get_started/bluedroid/Bluedroid_Beacon/README.md b/examples/bluetooth/ble_get_started/bluedroid/Bluedroid_Beacon/README.md index f86c4c7302..113c94670b 100644 --- a/examples/bluetooth/ble_get_started/bluedroid/Bluedroid_Beacon/README.md +++ b/examples/bluetooth/ble_get_started/bluedroid/Bluedroid_Beacon/README.md @@ -91,13 +91,14 @@ void app_main(void) { } ``` -Then, call `esp_bluedroid_init` and `esp_bluedroid_enable` function to initialize Bluedroid host stack. +Then, call `esp_bluedroid_init_with_cfg` and `esp_bluedroid_enable` function to initialize Bluedroid host stack. ``` C void app_main(void) { ... - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { ESP_LOGE(DEMO_TAG, "%s init bluetooth failed: %s", __func__, esp_err_to_name(ret)); return; @@ -118,7 +119,7 @@ After that, call `esp_ble_gap_register_callback` to register `esp_gap_cb` functi ``` C void app_main(void) { ... - + ret = esp_ble_gap_register_callback(esp_gap_cb); if (ret) { ESP_LOGE(DEMO_TAG, "gap register error, error code = %x", ret); @@ -174,7 +175,7 @@ static uint8_t scan_rsp_raw_data[] = { ``` C void app_main(void) { ... - + adv_config_done |= ADV_CONFIG_FLAG; adv_config_done |= SCAN_RSP_CONFIG_FLAG; ret = esp_ble_gap_config_adv_data_raw(adv_raw_data, sizeof(adv_raw_data)); diff --git a/examples/bluetooth/ble_get_started/bluedroid/Bluedroid_Beacon/main/main.c b/examples/bluetooth/ble_get_started/bluedroid/Bluedroid_Beacon/main/main.c index 39a163b03e..127d313a21 100644 --- a/examples/bluetooth/ble_get_started/bluedroid/Bluedroid_Beacon/main/main.c +++ b/examples/bluetooth/ble_get_started/bluedroid/Bluedroid_Beacon/main/main.c @@ -82,7 +82,8 @@ void app_main(void) return; } - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { ESP_LOGE(DEMO_TAG, "%s init bluetooth failed: %s", __func__, esp_err_to_name(ret)); return; diff --git a/examples/bluetooth/ble_get_started/bluedroid/Bluedroid_Connection/main/main.c b/examples/bluetooth/ble_get_started/bluedroid/Bluedroid_Connection/main/main.c index 07c6489e26..a5f886a83a 100644 --- a/examples/bluetooth/ble_get_started/bluedroid/Bluedroid_Connection/main/main.c +++ b/examples/bluetooth/ble_get_started/bluedroid/Bluedroid_Connection/main/main.c @@ -71,7 +71,8 @@ void app_main(void) return; } - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { ESP_LOGE(CONN_TAG, "%s init bluetooth failed: %s", __func__, esp_err_to_name(ret)); return; diff --git a/examples/bluetooth/ble_get_started/bluedroid/Bluedroid_GATT_Server/main/main.c b/examples/bluetooth/ble_get_started/bluedroid/Bluedroid_GATT_Server/main/main.c index 07e19e6b24..af91711945 100644 --- a/examples/bluetooth/ble_get_started/bluedroid/Bluedroid_GATT_Server/main/main.c +++ b/examples/bluetooth/ble_get_started/bluedroid/Bluedroid_GATT_Server/main/main.c @@ -462,7 +462,8 @@ void app_main(void) return; } - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { ESP_LOGE(GATTS_TAG, "%s init bluetooth failed: %s", __func__, esp_err_to_name(ret)); return; 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 04994799e8..506765c8f3 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 @@ -646,7 +646,8 @@ void app_main(void) ESP_LOGI(BLE_ANCS_TAG, "%s init bluetooth", __func__); - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { ESP_LOGE(BLE_ANCS_TAG, "%s init bluetooth failed: %s", __func__, esp_err_to_name(ret)); return; diff --git a/examples/bluetooth/bluedroid/ble/ble_compatibility_test/main/ble_compatibility_test.c b/examples/bluetooth/bluedroid/ble/ble_compatibility_test/main/ble_compatibility_test.c index 34b6cc1185..bd79c34ee6 100644 --- a/examples/bluetooth/bluedroid/ble/ble_compatibility_test/main/ble_compatibility_test.c +++ b/examples/bluetooth/bluedroid/ble/ble_compatibility_test/main/ble_compatibility_test.c @@ -658,7 +658,8 @@ void app_main(void) return; } - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { ESP_LOGE(EXAMPLE_TAG, "%s init bluetooth failed: %s", __func__, esp_err_to_name(ret)); return; diff --git a/examples/bluetooth/bluedroid/ble/ble_eddystone_receiver/main/esp_eddystone_demo.c b/examples/bluetooth/bluedroid/ble/ble_eddystone_receiver/main/esp_eddystone_demo.c index f4849f8b7b..bca42f31a9 100644 --- a/examples/bluetooth/bluedroid/ble/ble_eddystone_receiver/main/esp_eddystone_demo.c +++ b/examples/bluetooth/bluedroid/ble/ble_eddystone_receiver/main/esp_eddystone_demo.c @@ -155,7 +155,8 @@ void esp_eddystone_appRegister(void) void esp_eddystone_init(void) { - esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + esp_bluedroid_init_with_cfg(&cfg); esp_bluedroid_enable(); esp_eddystone_appRegister(); } diff --git a/examples/bluetooth/bluedroid/ble/ble_eddystone_sender/main/esp_eddystone_demo.c b/examples/bluetooth/bluedroid/ble/ble_eddystone_sender/main/esp_eddystone_demo.c index 8b62d61d93..ffb6ec83b5 100644 --- a/examples/bluetooth/bluedroid/ble/ble_eddystone_sender/main/esp_eddystone_demo.c +++ b/examples/bluetooth/bluedroid/ble/ble_eddystone_sender/main/esp_eddystone_demo.c @@ -166,7 +166,8 @@ void esp_eddystone_appRegister(void) void esp_eddystone_init(void) { - esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + esp_bluedroid_init_with_cfg(&cfg); esp_bluedroid_enable(); esp_eddystone_appRegister(); } diff --git a/examples/bluetooth/bluedroid/ble/ble_hid_device_demo/main/ble_hidd_demo_main.c b/examples/bluetooth/bluedroid/ble/ble_hid_device_demo/main/ble_hidd_demo_main.c index 0a9240fb92..becac7e405 100644 --- a/examples/bluetooth/bluedroid/ble/ble_hid_device_demo/main/ble_hidd_demo_main.c +++ b/examples/bluetooth/bluedroid/ble/ble_hid_device_demo/main/ble_hidd_demo_main.c @@ -219,7 +219,8 @@ void app_main(void) return; } - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { ESP_LOGE(HID_DEMO_TAG, "%s init bluedroid failed", __func__); return; diff --git a/examples/bluetooth/bluedroid/ble/ble_ibeacon/main/ibeacon_demo.c b/examples/bluetooth/bluedroid/ble/ble_ibeacon/main/ibeacon_demo.c index 846f7fea31..ae5c672bcd 100644 --- a/examples/bluetooth/bluedroid/ble/ble_ibeacon/main/ibeacon_demo.c +++ b/examples/bluetooth/bluedroid/ble/ble_ibeacon/main/ibeacon_demo.c @@ -160,7 +160,8 @@ void ble_ibeacon_appRegister(void) void ble_ibeacon_init(void) { - esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + esp_bluedroid_init_with_cfg(&cfg); esp_bluedroid_enable(); ble_ibeacon_appRegister(); } diff --git a/examples/bluetooth/bluedroid/ble/ble_multi_conn/ble_multi_conn_cent/main/ble_multiconn_cent_demo.c b/examples/bluetooth/bluedroid/ble/ble_multi_conn/ble_multi_conn_cent/main/ble_multiconn_cent_demo.c index 49bf214bcf..6c669108c5 100644 --- a/examples/bluetooth/bluedroid/ble/ble_multi_conn/ble_multi_conn_cent/main/ble_multiconn_cent_demo.c +++ b/examples/bluetooth/bluedroid/ble/ble_multi_conn/ble_multi_conn_cent/main/ble_multiconn_cent_demo.c @@ -644,7 +644,8 @@ void app_main(void) return; } - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { ESP_LOGE(DEMO_TAG, "%s init bluetooth failed: %s", __func__, esp_err_to_name(ret)); return; diff --git a/examples/bluetooth/bluedroid/ble/ble_multi_conn/ble_multi_conn_prph/main/ble_multiconn_prph_demo.c b/examples/bluetooth/bluedroid/ble/ble_multi_conn/ble_multi_conn_prph/main/ble_multiconn_prph_demo.c index 43e6a34a21..8f2b2c0ede 100644 --- a/examples/bluetooth/bluedroid/ble/ble_multi_conn/ble_multi_conn_prph/main/ble_multiconn_prph_demo.c +++ b/examples/bluetooth/bluedroid/ble/ble_multi_conn/ble_multi_conn_prph/main/ble_multiconn_prph_demo.c @@ -356,7 +356,8 @@ void app_main(void) ESP_LOGI(DEMO_TAG, "%s init bluetooth", __func__); - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { ESP_LOGE(DEMO_TAG, "%s init bluetooth failed: %s", __func__, esp_err_to_name(ret)); return; 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 f38d4beff8..8b14b35e1d 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 @@ -685,7 +685,8 @@ void app_main(void) ESP_LOGI(GATTC_TAG, "%s init bluetooth", __func__); - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { ESP_LOGE(GATTC_TAG, "%s init bluetooth failed: %s", __func__, esp_err_to_name(ret)); return; diff --git a/examples/bluetooth/bluedroid/ble/ble_spp_server/main/ble_spp_server_demo.c b/examples/bluetooth/bluedroid/ble/ble_spp_server/main/ble_spp_server_demo.c index d2796402cf..4532235abe 100644 --- a/examples/bluetooth/bluedroid/ble/ble_spp_server/main/ble_spp_server_demo.c +++ b/examples/bluetooth/bluedroid/ble/ble_spp_server/main/ble_spp_server_demo.c @@ -746,7 +746,8 @@ void app_main(void) ESP_LOGI(GATTS_TABLE_TAG, "%s init bluetooth", __func__); - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { ESP_LOGE(GATTS_TABLE_TAG, "%s init bluetooth failed: %s", __func__, esp_err_to_name(ret)); return; 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 8759479bbe..c367969fc2 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 @@ -581,7 +581,8 @@ void app_main(void) return; } - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { ESP_LOGE(GATTC_TAG, "%s init bluetooth failed, error code = %x", __func__, ret); return; diff --git a/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_server/main/example_ble_server_throughput.c b/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_server/main/example_ble_server_throughput.c index 9569d04c73..391feb4f29 100644 --- a/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_server/main/example_ble_server_throughput.c +++ b/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_server/main/example_ble_server_throughput.c @@ -680,7 +680,8 @@ void app_main(void) return; } - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { ESP_LOGE(GATTS_TAG, "%s init bluetooth failed", __func__); return; 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 94d7786b8e..50c9df5cd2 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_client/main/gattc_demo.c +++ b/examples/bluetooth/bluedroid/ble/gatt_client/main/gattc_demo.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Unlicense OR CC0-1.0 */ @@ -487,7 +487,8 @@ void app_main(void) return; } - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg);; if (ret) { ESP_LOGE(GATTC_TAG, "%s init bluetooth failed: %s", __func__, esp_err_to_name(ret)); return; @@ -505,7 +506,8 @@ void app_main(void) ESP_ERROR_CHECK( esp_bluedroid_deinit() ); vTaskDelay(10/portTICK_PERIOD_MS); ESP_LOGI(GATTC_TAG, "Free memory: %" PRIu32 " bytes", esp_get_free_heap_size()); - ESP_ERROR_CHECK( esp_bluedroid_init() ); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ESP_ERROR_CHECK( esp_bluedroid_init_with_cfg(&cfg) ); ESP_ERROR_CHECK( esp_bluedroid_enable() ); vTaskDelay(10/portTICK_PERIOD_MS); } 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 9fdd2a6ac8..1129c06ec8 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 @@ -60,7 +60,8 @@ void app_main() return; } - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { ESP_LOGE(GATTC_TAG, "%s init bluetooth failed, error code = %x", __func__, ret); return; @@ -136,7 +137,7 @@ There are four Bluetooth modes supported: After the initialization of the BT controller, the Bluedroid stack, which includes the common definitions and APIs for both BT Classic and BLE, is initialized and enabled by using: ```c -ret = esp_bluedroid_init(); +ret = esp_bluedroid_init_with_cfg(&cfg); ret = esp_bluedroid_enable(); ``` The main function ends by registering the GAP and GATT event handlers, as well as the Application Profile and set the maximum supported MTU size. 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 7955da0c71..28e6774c53 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 @@ -559,7 +559,8 @@ void app_main(void) return; } - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { ESP_LOGE(GATTC_TAG, "%s init bluetooth failed: %s", __func__, esp_err_to_name(ret)); return; diff --git a/examples/bluetooth/bluedroid/ble/gatt_security_server/main/example_ble_sec_gatts_demo.c b/examples/bluetooth/bluedroid/ble/gatt_security_server/main/example_ble_sec_gatts_demo.c index 35def35da8..8d259d9a52 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_security_server/main/example_ble_sec_gatts_demo.c +++ b/examples/bluetooth/bluedroid/ble/gatt_security_server/main/example_ble_sec_gatts_demo.c @@ -543,7 +543,8 @@ void app_main(void) ESP_LOGI(GATTS_TABLE_TAG, "%s init bluetooth", __func__); - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { ESP_LOGE(GATTS_TABLE_TAG, "%s init bluetooth failed: %s", __func__, esp_err_to_name(ret)); return; diff --git a/examples/bluetooth/bluedroid/ble/gatt_server/main/gatts_demo.c b/examples/bluetooth/bluedroid/ble/gatt_server/main/gatts_demo.c index a6d8912fff..cb5206f0b5 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_server/main/gatts_demo.c +++ b/examples/bluetooth/bluedroid/ble/gatt_server/main/gatts_demo.c @@ -766,7 +766,8 @@ void app_main(void) return; } - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { ESP_LOGE(GATTS_TAG, "%s init bluetooth failed: %s", __func__, esp_err_to_name(ret)); return; diff --git a/examples/bluetooth/bluedroid/ble/gatt_server/tutorial/Gatt_Server_Example_Walkthrough.md b/examples/bluetooth/bluedroid/ble/gatt_server/tutorial/Gatt_Server_Example_Walkthrough.md index 0f22772271..1e48f7b91f 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_server/tutorial/Gatt_Server_Example_Walkthrough.md +++ b/examples/bluetooth/bluedroid/ble/gatt_server/tutorial/Gatt_Server_Example_Walkthrough.md @@ -63,7 +63,8 @@ The entry point to this example is the app_main() function: return; } - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { ESP_LOGE(GATTS_TAG, "%s init bluetooth failed", __func__); return; @@ -132,7 +133,7 @@ There are four Bluetooth modes supported: After the initialization of the BT controller, the Bluedroid stack, which includes the common definitions and APIs for both BT Classic and BLE, is initialized and enabled by using: ```c -ret = esp_bluedroid_init(); +ret = esp_bluedroid_init_with_cfg(&cfg); ret = esp_bluedroid_enable(); ``` The Bluetooth stack is up and running at this point in the program flow, however the functionality of the application has not been defined yet. The functionality is defined by reacting to events such as what happens when another device tries to read or write parameters and establish a connection. The two main managers of events are the GAP and GATT event handlers. The application needs to register a callback function for each event handler in order to let the application know which functions are going to handle the GAP and GATT events: diff --git a/examples/bluetooth/bluedroid/ble/gatt_server_service_table/main/gatts_table_creat_demo.c b/examples/bluetooth/bluedroid/ble/gatt_server_service_table/main/gatts_table_creat_demo.c index 9c468cd351..650d716cdf 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_server_service_table/main/gatts_table_creat_demo.c +++ b/examples/bluetooth/bluedroid/ble/gatt_server_service_table/main/gatts_table_creat_demo.c @@ -544,7 +544,8 @@ void app_main(void) return; } - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { ESP_LOGE(GATTS_TABLE_TAG, "%s init bluetooth failed: %s", __func__, esp_err_to_name(ret)); return; diff --git a/examples/bluetooth/bluedroid/ble/gatt_server_service_table/tutorial/Gatt_Server_Service_Table_Example_Walkthrough.md b/examples/bluetooth/bluedroid/ble/gatt_server_service_table/tutorial/Gatt_Server_Service_Table_Example_Walkthrough.md index ea255f2d5d..555b80eb68 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_server_service_table/tutorial/Gatt_Server_Service_Table_Example_Walkthrough.md +++ b/examples/bluetooth/bluedroid/ble/gatt_server_service_table/tutorial/Gatt_Server_Service_Table_Example_Walkthrough.md @@ -101,7 +101,8 @@ void app_main() ESP_LOGI(GATTS_TABLE_TAG, "%s init bluetooth", __func__); - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { ESP_LOGE(GATTS_TABLE_TAG, "%s init bluetooth failed", __func__); return; 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 0908e5e4ee..28920bd988 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 @@ -954,7 +954,8 @@ void app_main(void) return; } - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { ESP_LOGE(GATTC_TAG, "%s init bluetooth failed: %s", __func__, esp_err_to_name(ret)); return; 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 720fd61924..286286138f 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 @@ -589,7 +589,8 @@ void app_main(void) return; } - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { ESP_LOGE(GATTC_TAG, "%s init bluetooth failed: %s", __func__, esp_err_to_name(ret)); return; diff --git a/examples/bluetooth/bluedroid/ble_50/ble50_security_server/main/ble50_sec_gatts_demo.c b/examples/bluetooth/bluedroid/ble_50/ble50_security_server/main/ble50_sec_gatts_demo.c index e5727564e4..3e7a3a452f 100644 --- a/examples/bluetooth/bluedroid/ble_50/ble50_security_server/main/ble50_sec_gatts_demo.c +++ b/examples/bluetooth/bluedroid/ble_50/ble50_security_server/main/ble50_sec_gatts_demo.c @@ -507,7 +507,8 @@ void app_main(void) ESP_LOGI(GATTS_TABLE_TAG, "%s init bluetooth", __func__); - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { ESP_LOGE(GATTS_TABLE_TAG, "%s init bluetooth failed: %s", __func__, esp_err_to_name(ret)); return; diff --git a/examples/bluetooth/bluedroid/ble_50/ble50_throughput/throughput_client/main/example_ble_client_throughput.c b/examples/bluetooth/bluedroid/ble_50/ble50_throughput/throughput_client/main/example_ble_client_throughput.c index 17c9a99d82..c0d7ae3a08 100644 --- a/examples/bluetooth/bluedroid/ble_50/ble50_throughput/throughput_client/main/example_ble_client_throughput.c +++ b/examples/bluetooth/bluedroid/ble_50/ble50_throughput/throughput_client/main/example_ble_client_throughput.c @@ -599,7 +599,8 @@ void app_main(void) return; } - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { ESP_LOGE(GATTC_TAG, "%s init bluetooth failed, error code = %x", __func__, ret); return; diff --git a/examples/bluetooth/bluedroid/ble_50/ble50_throughput/throughput_server/main/example_ble_server_throughput.c b/examples/bluetooth/bluedroid/ble_50/ble50_throughput/throughput_server/main/example_ble_server_throughput.c index d7d00133ed..057229fffb 100644 --- a/examples/bluetooth/bluedroid/ble_50/ble50_throughput/throughput_server/main/example_ble_server_throughput.c +++ b/examples/bluetooth/bluedroid/ble_50/ble50_throughput/throughput_server/main/example_ble_server_throughput.c @@ -589,7 +589,8 @@ void app_main(void) return; } - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { ESP_LOGE(GATTS_TAG, "%s init bluetooth failed", __func__); return; diff --git a/examples/bluetooth/bluedroid/ble_50/multi-adv/main/multi_adv_demo.c b/examples/bluetooth/bluedroid/ble_50/multi-adv/main/multi_adv_demo.c index db750ce70b..f3413a8232 100644 --- a/examples/bluetooth/bluedroid/ble_50/multi-adv/main/multi_adv_demo.c +++ b/examples/bluetooth/bluedroid/ble_50/multi-adv/main/multi_adv_demo.c @@ -215,7 +215,8 @@ void app_main(void) return; } - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { ESP_LOGE(LOG_TAG, "%s init bluetooth failed: %s", __func__, esp_err_to_name(ret)); return; diff --git a/examples/bluetooth/bluedroid/ble_50/multi-adv/tutorial/Mulit_Adv_Example_Walkthrough.md b/examples/bluetooth/bluedroid/ble_50/multi-adv/tutorial/Mulit_Adv_Example_Walkthrough.md index 369ed3f845..e636120bef 100644 --- a/examples/bluetooth/bluedroid/ble_50/multi-adv/tutorial/Mulit_Adv_Example_Walkthrough.md +++ b/examples/bluetooth/bluedroid/ble_50/multi-adv/tutorial/Mulit_Adv_Example_Walkthrough.md @@ -66,7 +66,8 @@ void app_main(void) return; } - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { ESP_LOGE(LOG_TAG, "%s init bluetooth failed: %s", __func__, esp_err_to_name(ret)); return; @@ -145,7 +146,7 @@ There are four Bluetooth modes supported: After the initialization of the BT controller, the Bluedroid stack, which includes the common definitions and APIs for both BT Classic and BLE, is initialized and enabled by using: ```c -ret = esp_bluedroid_init(); +ret = esp_bluedroid_init_with_cfg(&cfg); ret = esp_bluedroid_enable(); ``` The Bluetooth stack is up and running at this point in the program flow, however the functionality of the application has not been defined yet. The functionality is defined by reacting to events diff --git a/examples/bluetooth/bluedroid/ble_50/periodic_adv/main/periodic_adv_demo.c b/examples/bluetooth/bluedroid/ble_50/periodic_adv/main/periodic_adv_demo.c index aa7ffdac2a..abaeb219d8 100644 --- a/examples/bluetooth/bluedroid/ble_50/periodic_adv/main/periodic_adv_demo.c +++ b/examples/bluetooth/bluedroid/ble_50/periodic_adv/main/periodic_adv_demo.c @@ -174,7 +174,8 @@ void app_main(void) return; } - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { ESP_LOGE(LOG_TAG, "%s init bluetooth failed: %s", __func__, esp_err_to_name(ret)); return; diff --git a/examples/bluetooth/bluedroid/ble_50/periodic_adv/tutorial/Periodic_adv_Example_Walkthrough.md b/examples/bluetooth/bluedroid/ble_50/periodic_adv/tutorial/Periodic_adv_Example_Walkthrough.md index 3f99664ac6..8d8ac779ce 100644 --- a/examples/bluetooth/bluedroid/ble_50/periodic_adv/tutorial/Periodic_adv_Example_Walkthrough.md +++ b/examples/bluetooth/bluedroid/ble_50/periodic_adv/tutorial/Periodic_adv_Example_Walkthrough.md @@ -67,7 +67,8 @@ void app_main(void) return; } - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { ESP_LOGE(LOG_TAG, "%s init bluetooth failed: %s", __func__, esp_err_to_name(ret)); return; @@ -95,7 +96,7 @@ a_2m), &raw_ext_adv_data_2m[0]), test_sem); // start all adv FUNC_SEND_WAIT_SEM(esp_ble_gap_ext_adv_start(NUM_EXT_ADV, &ext_adv[0]), test_sem); - + // set periodic adv param FUNC_SEND_WAIT_SEM(esp_ble_gap_periodic_adv_set_params(EXT_ADV_HANDLE, &periodic_adv_params), test_sem); @@ -152,7 +153,7 @@ There are four Bluetooth modes supported: After the initialization of the BT controller, the Bluedroid stack, which includes the common definitions and APIs for both BT Classic and BLE, is initialized and enabled by using: ```c -ret = esp_bluedroid_init(); +ret = esp_bluedroid_init_with_cfg(&cfg); ret = esp_bluedroid_enable(); ``` The Bluetooth stack is up and running at this point in the program flow, however the functionality of the application has not been defined yet. The functionality is defined by reacting to events such as what happens when another device tries to read or write parameters and establish a connection. The two main managers of events are the GAP and GATT event handlers. The application needs to register a callback function for each event handler in order to let the application know which functions are going to handle the GAP and GATT events: diff --git a/examples/bluetooth/bluedroid/ble_50/periodic_sync/main/periodic_sync_demo.c b/examples/bluetooth/bluedroid/ble_50/periodic_sync/main/periodic_sync_demo.c index f70bf1e8b2..92194f1e96 100644 --- a/examples/bluetooth/bluedroid/ble_50/periodic_sync/main/periodic_sync_demo.c +++ b/examples/bluetooth/bluedroid/ble_50/periodic_sync/main/periodic_sync_demo.c @@ -170,7 +170,8 @@ void app_main(void) return; } - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { ESP_LOGE(LOG_TAG, "%s init bluetooth failed: %s", __func__, esp_err_to_name(ret)); return; diff --git a/examples/bluetooth/bluedroid/ble_50/periodic_sync/tutorial/Periodic_Sync_Example_Walkthrough.md b/examples/bluetooth/bluedroid/ble_50/periodic_sync/tutorial/Periodic_Sync_Example_Walkthrough.md index c53b9b3045..124471f9b7 100644 --- a/examples/bluetooth/bluedroid/ble_50/periodic_sync/tutorial/Periodic_Sync_Example_Walkthrough.md +++ b/examples/bluetooth/bluedroid/ble_50/periodic_sync/tutorial/Periodic_Sync_Example_Walkthrough.md @@ -87,7 +87,8 @@ void app_main(void) return; } - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { ESP_LOGE(LOG_TAG, "%s init bluetooth failed: %s", __func__, esp_err_to_name(ret)); return; @@ -152,7 +153,7 @@ There are four Bluetooth modes supported: After the initialization of the BT controller, the Bluedroid stack, which includes the common definitions and APIs for both BT Classic and BLE, is initialized and enabled by using: ```c -ret = esp_bluedroid_init(); +ret = esp_bluedroid_init_with_cfg(&cfg); ret = esp_bluedroid_enable(); ``` The main function ends by registering the GAP and GATT event handlers, as well as the Application Profile and set the maximum supported MTU size. diff --git a/examples/bluetooth/bluedroid/bluedroid_host_only/bluedroid_host_only_uart/main/main.c b/examples/bluetooth/bluedroid/bluedroid_host_only/bluedroid_host_only_uart/main/main.c index 455cab11a6..0dc7b4e26f 100644 --- a/examples/bluetooth/bluedroid/bluedroid_host_only/bluedroid_host_only_uart/main/main.c +++ b/examples/bluetooth/bluedroid/bluedroid_host_only/bluedroid_host_only_uart/main/main.c @@ -292,7 +292,8 @@ void app_main(void) }; esp_bluedroid_attach_hci_driver(&operations); - if ((ret = esp_bluedroid_init()) != ESP_OK) { + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + if ((esp_bluedroid_init_with_cfg(&cfg)) != ESP_OK) { ESP_LOGE(GAP_TAG, "%s initialize bluedroid failed: %s", __func__, esp_err_to_name(ret)); return; } diff --git a/examples/bluetooth/bluedroid/classic_bt/a2dp_sink/main/bt_app_av.c b/examples/bluetooth/bluedroid/classic_bt/a2dp_sink/main/bt_app_av.c index a6601f624c..9fd92b2d2b 100644 --- a/examples/bluetooth/bluedroid/classic_bt/a2dp_sink/main/bt_app_av.c +++ b/examples/bluetooth/bluedroid/classic_bt/a2dp_sink/main/bt_app_av.c @@ -75,7 +75,7 @@ static void bt_av_hdl_avrc_tg_evt(uint16_t event, void *p_param); ******************************/ static uint32_t s_pkt_cnt = 0; /* count for audio packet */ -static esp_a2d_audio_state_t s_audio_state = ESP_A2D_AUDIO_STATE_STOPPED; +static esp_a2d_audio_state_t s_audio_state = ESP_A2D_AUDIO_STATE_SUSPEND; /* audio stream datapath state */ static const char *s_a2d_conn_state_str[] = {"Disconnected", "Connecting", "Connected", "Disconnecting"}; /* connection state in string */ diff --git a/examples/bluetooth/bluedroid/coex/a2dp_gatts_coex/main/bt_app_av.c b/examples/bluetooth/bluedroid/coex/a2dp_gatts_coex/main/bt_app_av.c index b0b166209f..5ff79c9289 100644 --- a/examples/bluetooth/bluedroid/coex/a2dp_gatts_coex/main/bt_app_av.c +++ b/examples/bluetooth/bluedroid/coex/a2dp_gatts_coex/main/bt_app_av.c @@ -75,7 +75,7 @@ static void bt_av_hdl_avrc_tg_evt(uint16_t event, void *p_param); ******************************/ static uint32_t s_pkt_cnt = 0; /* count for audio packet */ -static esp_a2d_audio_state_t s_audio_state = ESP_A2D_AUDIO_STATE_STOPPED; +static esp_a2d_audio_state_t s_audio_state = ESP_A2D_AUDIO_STATE_SUSPEND; /* audio stream datapath state */ static const char *s_a2d_conn_state_str[] = {"Disconnected", "Connecting", "Connected", "Disconnecting"}; /* connection state in string */ 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 6d9627337b..269069f4a3 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 @@ -1037,7 +1037,8 @@ void app_main(void) return; } - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { ESP_LOGE(COEX_TAG, "%s init bluetooth failed: %s", __func__, esp_err_to_name(ret)); return; diff --git a/examples/bluetooth/blufi/main/blufi_init.c b/examples/bluetooth/blufi/main/blufi_init.c index ea998657e9..a17bed8c26 100644 --- a/examples/bluetooth/blufi/main/blufi_init.c +++ b/examples/bluetooth/blufi/main/blufi_init.c @@ -32,7 +32,8 @@ esp_err_t esp_blufi_host_init(void) { int ret; - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { BLUFI_ERROR("%s init bluedroid failed: %s\n", __func__, esp_err_to_name(ret)); return ESP_FAIL; diff --git a/examples/bluetooth/esp_ble_mesh/common_components/example_init/ble_mesh_example_init.c b/examples/bluetooth/esp_ble_mesh/common_components/example_init/ble_mesh_example_init.c index 8a4674a871..6af72d8e5a 100644 --- a/examples/bluetooth/esp_ble_mesh/common_components/example_init/ble_mesh_example_init.c +++ b/examples/bluetooth/esp_ble_mesh/common_components/example_init/ble_mesh_example_init.c @@ -62,7 +62,8 @@ esp_err_t bluetooth_init(void) return ret; } - ret = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + ret = esp_bluedroid_init_with_cfg(&cfg); if (ret) { ESP_LOGE(TAG, "%s init bluetooth failed", __func__); return ret; diff --git a/examples/bluetooth/esp_ble_mesh/wifi_coexist/tutorial/BLE_Mesh_WiFi_Coexist_Example_Walkthrough.md b/examples/bluetooth/esp_ble_mesh/wifi_coexist/tutorial/BLE_Mesh_WiFi_Coexist_Example_Walkthrough.md index 63a647fffc..d7e7623f08 100644 --- a/examples/bluetooth/esp_ble_mesh/wifi_coexist/tutorial/BLE_Mesh_WiFi_Coexist_Example_Walkthrough.md +++ b/examples/bluetooth/esp_ble_mesh/wifi_coexist/tutorial/BLE_Mesh_WiFi_Coexist_Example_Walkthrough.md @@ -173,7 +173,7 @@ This demo calls the `bluetooth_init` function to: After the initialization of the BT controller, the Bluedroid stack, which includes the common definitions and APIs for both BT Classic and BLE, is initialized and enabled by using: ``` - ret = esp_bluedroid_init(); + ret = esp_bluedroid_init_with_cfg(&cfg); ret = esp_bluedroid_enable(); ``` diff --git a/examples/system/ota/advanced_https_ota/main/ble_helper/ble_api.c b/examples/system/ota/advanced_https_ota/main/ble_helper/ble_api.c index 390d146f3b..52d58f3023 100644 --- a/examples/system/ota/advanced_https_ota/main/ble_helper/ble_api.c +++ b/examples/system/ota/advanced_https_ota/main/ble_helper/ble_api.c @@ -37,7 +37,8 @@ esp_err_t esp_ble_helper_init(void) return err; } - err = esp_bluedroid_init(); + esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); + err = esp_bluedroid_init_with_cfg(&cfg); if (err) { ESP_LOGE(TAG, "%s init bluetooth failed: %s", __func__, esp_err_to_name(err)); return err;