mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-02 18:10:57 +02:00
Merge branch 'feat/remove_the_deprecated_api_and_parameter' into 'master'
feat(bt): remove the deprecated functions and parameters Closes BT-4042 See merge request espressif/esp-idf!40435
This commit is contained in:
@@ -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;
|
||||
|
@@ -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)
|
||||
{
|
||||
|
@@ -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) {
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
||||
/**
|
||||
|
@@ -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.
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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: <ind> <value>" to HFP Client. "CIEV" means “indicator events reporting",
|
||||
|
@@ -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.
|
||||
*
|
||||
|
@@ -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
|
||||
|
@@ -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;
|
||||
|
||||
/**
|
||||
|
@@ -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
|
||||
|
@@ -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);
|
||||
|
@@ -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 */
|
||||
|
@@ -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);
|
||||
|
@@ -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 {
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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``.
|
@@ -6,6 +6,7 @@ Migration from 5.5 to 6.0
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
bluetooth-classic
|
||||
build-system
|
||||
peripherals
|
||||
provisioning
|
||||
|
@@ -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`` 替代。
|
||||
|
@@ -6,6 +6,7 @@
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
bluetooth-classic
|
||||
build-system
|
||||
peripherals
|
||||
provisioning
|
||||
|
@@ -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));
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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();
|
||||
}
|
||||
|
@@ -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();
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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();
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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.
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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:
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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
|
||||
|
@@ -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;
|
||||
|
@@ -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:
|
||||
|
@@ -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;
|
||||
|
@@ -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.
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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 */
|
||||
|
@@ -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 */
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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();
|
||||
```
|
||||
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user