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 514e533f64..254eccf69f 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 @@ -14,31 +14,27 @@ extern "C" { #endif -/** - * @brief Media codec types supported by A2DP. - */ +/* Media codec types supported by A2DP. */ #define ESP_A2D_MCT_SBC (0) /*!< SBC */ #define ESP_A2D_MCT_M12 (0x01) /*!< MPEG-1, 2 Audio */ #define ESP_A2D_MCT_M24 (0x02) /*!< MPEG-2, 4 AAC */ #define ESP_A2D_MCT_ATRAC (0x04) /*!< ATRAC family */ #define ESP_A2D_MCT_NON_A2DP (0xff) /*!< NON-A2DP */ -typedef uint8_t esp_a2d_mct_t; +typedef uint8_t esp_a2d_mct_t; /*!< Media codec type of A2DP */ -/** - * @brief Protocol service capabilities. This value is a mask. - */ +/* Protocol service capabilities. This value is a mask. */ #define ESP_A2D_PSC_DELAY_RPT (1<<0) /*!< Delay Report */ -typedef uint16_t esp_a2d_psc_t; +typedef uint16_t esp_a2d_psc_t; /*!< Protocol service capabilities type */ /** * @brief A2DP media codec capabilities union */ typedef struct { esp_a2d_mct_t type; /*!< A2DP media codec type */ -#define ESP_A2D_CIE_LEN_SBC (4) -#define ESP_A2D_CIE_LEN_M12 (4) -#define ESP_A2D_CIE_LEN_M24 (6) -#define ESP_A2D_CIE_LEN_ATRAC (7) +#define ESP_A2D_CIE_LEN_SBC (4) /*!< SBC cie length */ +#define ESP_A2D_CIE_LEN_M12 (4) /*!< MPEG-1,2 cie length */ +#define ESP_A2D_CIE_LEN_M24 (6) /*!< MPEG-2,4 AAC cie length */ +#define ESP_A2D_CIE_LEN_ATRAC (7) /*!< ATRAC family cie length */ union { uint8_t sbc[ESP_A2D_CIE_LEN_SBC]; /*!< SBC codec capabilities */ uint8_t m12[ESP_A2D_CIE_LEN_M12]; /*!< MPEG-1,2 audio codec capabilities */ @@ -100,7 +96,7 @@ typedef enum { */ typedef enum { ESP_A2D_DEINIT_SUCCESS = 0, /*!< A2DP profile deinit successful event */ - ESP_A2D_INIT_SUCCESS /*!< A2DP profile deinit successful event */ + ESP_A2D_INIT_SUCCESS /*!< A2DP profile init successful event */ } esp_a2d_init_state_t; /** @@ -213,9 +209,9 @@ typedef union { /** * @brief A2DP profile callback function type * - * @param event : Event type + * @param[in] event : Event type * - * @param param : Pointer to callback parameter + * @param[in] param : Pointer to callback parameter */ typedef void (* esp_a2d_cb_t)(esp_a2d_cb_event_t event, esp_a2d_cb_param_t *param); @@ -257,7 +253,6 @@ typedef int32_t (* esp_a2d_source_data_cb_t)(uint8_t *buf, int32_t len); */ esp_err_t esp_a2d_register_callback(esp_a2d_cb_t callback); - /** * @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() @@ -274,7 +269,6 @@ esp_err_t esp_a2d_register_callback(esp_a2d_cb_t callback); */ esp_err_t esp_a2d_sink_register_data_callback(esp_a2d_sink_data_cb_t callback); - /** * * @brief Initialize the bluetooth A2DP sink module. This function should be called @@ -291,7 +285,6 @@ esp_err_t esp_a2d_sink_register_data_callback(esp_a2d_sink_data_cb_t callback); */ esp_err_t esp_a2d_sink_init(void); - /** * * @brief De-initialize for A2DP sink module. This function @@ -306,7 +299,6 @@ esp_err_t esp_a2d_sink_init(void); */ esp_err_t esp_a2d_sink_deinit(void); - /** * * @brief Connect to remote bluetooth A2DP source device. This API must be called after @@ -322,7 +314,6 @@ esp_err_t esp_a2d_sink_deinit(void); */ esp_err_t esp_a2d_sink_connect(esp_bd_addr_t remote_bda); - /** * * @brief Disconnect from the remote A2DP source device. This API must be called after @@ -368,7 +359,6 @@ esp_err_t esp_a2d_sink_set_delay_value(uint16_t delay_value); */ esp_err_t esp_a2d_sink_get_delay_value(void); - /** * * @brief Media control commands. This API can be used for both A2DP sink and source @@ -384,7 +374,6 @@ esp_err_t esp_a2d_sink_get_delay_value(void); */ esp_err_t esp_a2d_media_ctrl(esp_a2d_media_ctrl_t ctrl); - /** * @brief This function is used to get the status of A2DP * @@ -396,7 +385,6 @@ esp_err_t esp_a2d_media_ctrl(esp_a2d_media_ctrl_t ctrl); */ esp_err_t esp_a2d_get_profile_status(esp_a2d_profile_status_t *profile_status); - /** * * @brief Initialize the bluetooth A2DP source module. A2DP can work independently. @@ -413,7 +401,6 @@ esp_err_t esp_a2d_get_profile_status(esp_a2d_profile_status_t *profile_status); */ esp_err_t esp_a2d_source_init(void); - /** * * @brief De-initialize for A2DP source module. This function @@ -428,7 +415,6 @@ esp_err_t esp_a2d_source_init(void); */ esp_err_t esp_a2d_source_deinit(void); - /** * @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 @@ -445,7 +431,6 @@ esp_err_t esp_a2d_source_deinit(void); */ esp_err_t esp_a2d_source_register_data_callback(esp_a2d_source_data_cb_t callback); - /** * * @brief Connect to remote A2DP sink device. This API must be called @@ -461,7 +446,6 @@ esp_err_t esp_a2d_source_register_data_callback(esp_a2d_source_data_cb_t callbac */ esp_err_t esp_a2d_source_connect(esp_bd_addr_t remote_bda); - /** * * @brief Disconnect from the remote A2DP sink device. This API must be called @@ -480,5 +464,4 @@ esp_err_t esp_a2d_source_disconnect(esp_bd_addr_t remote_bda); } #endif - #endif /* __ESP_A2DP_API_H__ */ diff --git a/components/bt/host/bluedroid/api/include/api/esp_avrc_api.h b/components/bt/host/bluedroid/api/include/api/esp_avrc_api.h index 15fd2c72ec..86eb6dca4e 100644 --- a/components/bt/host/bluedroid/api/include/api/esp_avrc_api.h +++ b/components/bt/host/bluedroid/api/include/api/esp_avrc_api.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -105,7 +105,7 @@ typedef enum { typedef enum { ESP_AVRC_PSTH_FILTER_ALLOWED_CMD = 0, /*!< all of the PASSTHROUGH commands that can possibly be used, immutable */ ESP_AVRC_PSTH_FILTER_SUPPORTED_CMD = 1, /*!< PASSTHROUGH commands selectively supported according to the current configuration */ - ESP_AVRC_PSTH_FILTER_SUPPORT_MAX, + ESP_AVRC_PSTH_FILTER_SUPPORT_MAX, /*!< Maximum value for PASSTHROUGH command filter */ } esp_avrc_psth_filter_t; /// AVRC passthrough command bit mask @@ -113,6 +113,7 @@ typedef struct { uint16_t bits[8]; /*!< bit mask representation of PASSTHROUGH commands */ } esp_avrc_psth_bit_mask_t; +/// AVRC operation code bit mask typedef enum { ESP_AVRC_BIT_MASK_OP_TEST = 0, /*!< operation code to test a specific bit */ ESP_AVRC_BIT_MASK_OP_SET = 1, /*!< operation code to set a specific bit */ @@ -175,14 +176,14 @@ typedef enum { ESP_AVRC_RN_ADDRESSED_PLAYER_CHANGE = 0x0b, /*!< the addressed player changed */ ESP_AVRC_RN_UIDS_CHANGE = 0x0c, /*!< UIDs changed */ ESP_AVRC_RN_VOLUME_CHANGE = 0x0d, /*!< volume changed locally on TG */ - ESP_AVRC_RN_MAX_EVT + ESP_AVRC_RN_MAX_EVT /*!< maximum value for notification event */ } esp_avrc_rn_event_ids_t; /// AVRC target notification event notification capability typedef enum { ESP_AVRC_RN_CAP_ALLOWED_EVT = 0, /*!< all of the notification events that can possibly be supported, immutable */ ESP_AVRC_RN_CAP_SUPPORTED_EVT = 1, /*!< notification events selectively supported according to the current configuration */ - ESP_AVRC_RN_CAP_MAX, + ESP_AVRC_RN_CAP_MAX, /*!< maximum value for the notification event capability */ } esp_avrc_rn_evt_cap_t; /// AVRC target notification event capability bit mask @@ -202,7 +203,7 @@ typedef enum { ESP_AVRC_PS_REPEAT_MODE = 0x02, /*!< repeat mode */ ESP_AVRC_PS_SHUFFLE_MODE = 0x03, /*!< shuffle mode */ ESP_AVRC_PS_SCAN_MODE = 0x04, /*!< scan mode on or off */ - ESP_AVRC_PS_MAX_ATTR + ESP_AVRC_PS_MAX_ATTR /*!< Maximum value for player setting attribute ids*/ } esp_avrc_ps_attr_ids_t; /// AVRC equalizer modes @@ -221,9 +222,9 @@ typedef enum { /// AVRC shuffle modes typedef enum { - ESP_AVRC_PS_SHUFFLE_OFF = 0x1, /*, Terminate all held or set UDUB("busy") to a waiting call */ - ESP_HF_CHLD_TYPE_REL_ACC, /*!< <1>, Terminate all active calls and accepts a waiting/held call */ - ESP_HF_CHLD_TYPE_HOLD_ACC, /*!< <2>, Hold all active calls and accepts a waiting/held call */ + ESP_HF_CHLD_TYPE_REL_ACC, /*!< <1>, Terminate all active calls and accept a waiting/held call */ + ESP_HF_CHLD_TYPE_HOLD_ACC, /*!< <2>, Hold all active calls and accept a waiting/held call */ ESP_HF_CHLD_TYPE_MERGE, /*!< <3>, Add all held calls to a conference */ - ESP_HF_CHLD_TYPE_MERGE_DETACH, /*!< <4>, connect the two calls and disconnects the subscriber from both calls */ - ESP_HF_CHLD_TYPE_REL_X, /*!< <1x>, releases specified calls only */ + ESP_HF_CHLD_TYPE_MERGE_DETACH, /*!< <4>, connect the two calls and disconnect the subscriber from both calls */ + ESP_HF_CHLD_TYPE_REL_X, /*!< <1x>, release specified calls only */ ESP_HF_CHLD_TYPE_PRIV_X, /*!< <2x>, request private consultation mode with specified call */ } esp_hf_chld_type_t; @@ -218,8 +219,8 @@ typedef enum { /* AT response code - OK/Error */ typedef enum { - ESP_HF_AT_RESPONSE_ERROR = 0, - ESP_HF_AT_RESPONSE_OK + ESP_HF_AT_RESPONSE_ERROR = 0, /*!< error in the AT command response */ + ESP_HF_AT_RESPONSE_OK /*!< successful AT command response */ } esp_hf_at_response_t; /// Extended Audio Gateway Error Result Code Response @@ -240,7 +241,7 @@ typedef enum { ESP_HF_CME_MEMORY_FULL = 20, /*!< memory full */ ESP_HF_CME_INVALID_INDEX = 21, /*!< invalid index */ ESP_HF_CME_MEMORY_FAILURE = 23, /*!< memory failure */ - ESP_HF_CME_TEXT_STRING_TOO_LONG = 24, /*!< test string too long */ + ESP_HF_CME_TEXT_STRING_TOO_LONG = 24, /*!< text string too long */ ESP_HF_CME_INVALID_CHARACTERS_IN_TEXT_STRING = 25, /*!< invalid characters in text string */ ESP_HF_CME_DIAL_STRING_TOO_LONG = 26, /*!< dial string too long*/ ESP_HF_CME_INVALID_CHARACTERS_IN_DIAL_STRING = 27, /*!< invalid characters in dial string */ 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..2348e752d5 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 * @@ -16,7 +16,7 @@ extern "C" { #endif -/// subclass of hid device +/* subclass of hid device */ #define ESP_HID_CLASS_UNKNOWN (0x00<<2) /*!< unknown HID device subclass */ #define ESP_HID_CLASS_JOS (0x01<<2) /*!< joystick */ #define ESP_HID_CLASS_GPD (0x02<<2) /*!< game pad */ @@ -57,9 +57,9 @@ typedef enum { */ typedef enum { ESP_HIDD_CONN_STATE_CONNECTED, /*!< HID connection established */ - ESP_HIDD_CONN_STATE_CONNECTING, /*!< connection to remote Bluetooth device */ + ESP_HIDD_CONN_STATE_CONNECTING, /*!< connecting to remote Bluetooth device */ ESP_HIDD_CONN_STATE_DISCONNECTED, /*!< connection released */ - ESP_HIDD_CONN_STATE_DISCONNECTING, /*!< disconnecting to remote Bluetooth device*/ + ESP_HIDD_CONN_STATE_DISCONNECTING, /*!< disconnecting from remote Bluetooth device*/ ESP_HIDD_CONN_STATE_UNKNOWN, /*!< unknown connection state */ } esp_hidd_connection_state_t; @@ -116,32 +116,35 @@ typedef struct { * @brief HID device callback function events */ typedef enum { - ESP_HIDD_INIT_EVT = 0, /*!< When HID device is initialized, the event comes */ - ESP_HIDD_DEINIT_EVT, /*!< When HID device is deinitialized, the event comes */ - ESP_HIDD_REGISTER_APP_EVT, /*!< When HID device application registered, the event comes */ - ESP_HIDD_UNREGISTER_APP_EVT, /*!< When HID device application unregistered, the event comes */ - ESP_HIDD_OPEN_EVT, /*!< When HID device connection to host opened, the event comes */ - ESP_HIDD_CLOSE_EVT, /*!< When HID device connection to host closed, the event comes */ - ESP_HIDD_SEND_REPORT_EVT, /*!< When HID device send report to lower layer, the event comes */ - ESP_HIDD_REPORT_ERR_EVT, /*!< When HID device report handshanke error to lower layer, the event comes */ - ESP_HIDD_GET_REPORT_EVT, /*!< When HID device receives GET_REPORT request from host, the event comes */ - ESP_HIDD_SET_REPORT_EVT, /*!< When HID device receives SET_REPORT request from host, the event comes */ - ESP_HIDD_SET_PROTOCOL_EVT, /*!< When HID device receives SET_PROTOCOL request from host, the event comes */ - ESP_HIDD_INTR_DATA_EVT, /*!< When HID device receives DATA from host on intr, the event comes */ - ESP_HIDD_VC_UNPLUG_EVT, /*!< When HID device initiates Virtual Cable Unplug, the event comes */ - ESP_HIDD_API_ERR_EVT /*!< When HID device has API error, the event comes */ + ESP_HIDD_INIT_EVT = 0, /*!< HID device initialized. */ + ESP_HIDD_DEINIT_EVT, /*!< HID device deinitialized. */ + ESP_HIDD_REGISTER_APP_EVT, /*!< HID device application registered. */ + ESP_HIDD_UNREGISTER_APP_EVT, /*!< HID device application unregistered. */ + ESP_HIDD_OPEN_EVT, /*!< HID device connection to host opened. */ + ESP_HIDD_CLOSE_EVT, /*!< HID device connection to host closed. */ + ESP_HIDD_SEND_REPORT_EVT, /*!< HID device sent report to lower layer. */ + ESP_HIDD_REPORT_ERR_EVT, /*!< HID device reported handshake error to lower layer. */ + ESP_HIDD_GET_REPORT_EVT, /*!< HID device received GET_REPORT request from host. */ + ESP_HIDD_SET_REPORT_EVT, /*!< HID device received SET_REPORT request from host. */ + ESP_HIDD_SET_PROTOCOL_EVT, /*!< HID device received SET_PROTOCOL request from host. */ + ESP_HIDD_INTR_DATA_EVT, /*!< HID device received DATA from host on interrupt channel. */ + ESP_HIDD_VC_UNPLUG_EVT, /*!< HID device initiated Virtual Cable Unplug. */ + ESP_HIDD_API_ERR_EVT /*!< HID device had API error. */ } esp_hidd_cb_event_t; +/** + * @brief HID device status + */ typedef enum { - ESP_HIDD_SUCCESS, - ESP_HIDD_ERROR, /*!< general ESP HD error */ + ESP_HIDD_SUCCESS, /*!< successful */ + ESP_HIDD_ERROR, /*!< general ESP HID error */ ESP_HIDD_NO_RES, /*!< out of system resources */ ESP_HIDD_BUSY, /*!< Temporarily can not handle this request. */ ESP_HIDD_NO_DATA, /*!< No data. */ - ESP_HIDD_NEED_INIT, /*!< HIDD module shall init first */ - ESP_HIDD_NEED_DEINIT, /*!< HIDD module shall deinit first */ - ESP_HIDD_NEED_REG, /*!< HIDD module shall register first */ - ESP_HIDD_NEED_DEREG, /*!< HIDD module shall deregister first */ + ESP_HIDD_NEED_INIT, /*!< HIDD module must be initialized first. */ + ESP_HIDD_NEED_DEINIT, /*!< HIDD module must be deinitialized first. */ + ESP_HIDD_NEED_REG, /*!< HIDD module must be registered first. */ + ESP_HIDD_NEED_DEREG, /*!< HIDD module must be deregistered first. */ ESP_HIDD_NO_CONNECTION, /*!< connection may have been closed */ } esp_hidd_status_t; @@ -270,8 +273,8 @@ typedef union { /** * @brief HID device callback function type. - * @param event: Event type - * @param param: Point to callback parameter, currently is union type + * @param[in] event: Event type + * @param[in] param: Point to callback parameter, currently is union type */ typedef void (*esp_hd_cb_t)(esp_hidd_cb_event_t event, esp_hidd_cb_param_t *param); 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..e23416c211 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 @@ -52,7 +52,7 @@ typedef enum { ESP_HIDH_BUSY, /*!< vendor-defined: temporarily can not handle this request */ ESP_HIDH_NO_DATA, /*!< vendor-defined: no data. */ ESP_HIDH_NEED_INIT, /*!< vendor-defined: HIDH module shall initialize first */ - ESP_HIDH_NEED_DEINIT, /*!< vendor-defined: HIDH module shall de-deinitialize first */ + ESP_HIDH_NEED_DEINIT, /*!< vendor-defined: HIDH module shall deinitialize first */ ESP_HIDH_NO_CONNECTION, /*!< vendor-defined: connection may have been closed */ } esp_hidh_status_t; @@ -309,8 +309,8 @@ typedef union { /** * @brief HID host callback function type - * @param event: Event type - * @param param: Point to callback parameter, currently is union type + * @param[in] event: Event type + * @param[in] param: Point to callback parameter, currently is union type */ typedef void (*esp_hh_cb_t)(esp_hidh_cb_event_t event, esp_hidh_cb_param_t *param); diff --git a/components/bt/host/bluedroid/api/include/api/esp_l2cap_bt_api.h b/components/bt/host/bluedroid/api/include/api/esp_l2cap_bt_api.h index 982cbdaa85..faa13ccdc5 100644 --- a/components/bt/host/bluedroid/api/include/api/esp_l2cap_bt_api.h +++ b/components/bt/host/bluedroid/api/include/api/esp_l2cap_bt_api.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -28,17 +28,18 @@ typedef enum { ESP_BT_L2CAP_NO_SERVER, /*!< No server */ } esp_bt_l2cap_status_t; -/** - * @brief Security Setting Mask. Use these three mask mode: - * 1. ESP_BT_L2CAP_SEC_NONE - * 2. ESP_BT_L2CAP_SEC_AUTHENTICATE - * 3. (ESP_BT_L2CAP_SEC_ENCRYPT|ESP_BT_L2CAP_SEC_AUTHENTICATE) +/* + * Security setting mask for L2CAP. + * - Use one of the following mask modes: + * 1. `ESP_BT_L2CAP_SEC_NONE` + * 2. `ESP_BT_L2CAP_SEC_AUTHENTICATE` + * 3. (`ESP_BT_L2CAP_SEC_ENCRYPT` | `ESP_BT_L2CAP_SEC_AUTHENTICATE`) */ #define ESP_BT_L2CAP_SEC_NONE 0x0000 /*!< No security */ #define ESP_BT_L2CAP_SEC_AUTHORIZE 0x0001 /*!< Authorization required */ #define ESP_BT_L2CAP_SEC_AUTHENTICATE 0x0012 /*!< Authentication required */ #define ESP_BT_L2CAP_SEC_ENCRYPT 0x0024 /*!< Encryption required */ -typedef uint32_t esp_bt_l2cap_cntl_flags_t; +typedef uint32_t esp_bt_l2cap_cntl_flags_t; /*!< L2CAP control flags type */ /** * @brief L2CAP status parameters @@ -146,8 +147,8 @@ typedef union { /** * @brief L2CAP callback function type. * - * @param event: Event type - * @param param: Point to callback parameter, currently is union type + * @param[in] event: Event type + * @param[in] param: Point to callback parameter, currently is union type */ typedef void (* esp_bt_l2cap_cb_t)(esp_bt_l2cap_cb_event_t event, esp_bt_l2cap_cb_param_t *param); @@ -203,11 +204,12 @@ esp_err_t esp_bt_l2cap_deinit(void); esp_err_t esp_bt_l2cap_connect(esp_bt_l2cap_cntl_flags_t cntl_flag, uint16_t remote_psm, esp_bd_addr_t peer_bd_addr); /** - * @brief This function create a L2CAP server and starts listening for an - * L2CAP connection request from a remote Bluetooth device. - * When the server is started successfully, the callback is called with ESP_BT_L2CAP_START_EVT. - * When the connection is established, the callback is called with ESP_BT_L2CAP_OPEN_EVT. - * This function must be called after esp_bt_l2cap_init() successful and before esp_bt_l2cap_deinit(). +* @brief Create an L2CAP server and start listening for connection requests. + * + * @note + * - When the server is started successfully, the callback is called with `ESP_BT_L2CAP_START_EVT`. + * - When the connection is established, the callback is called with `ESP_BT_L2CAP_OPEN_EVT`. + * - This function must be called after `esp_bt_l2cap_init()` and before `esp_bt_l2cap_deinit()`. * * @param[in] cntl_flag: Lower 16-bit security settings mask. * @param[in] local_psm: Dynamic PSM. 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 07b6225a33..e89f63d544 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 @@ -25,9 +25,13 @@ extern "C" { #define ESP_SDP_UUID_SAP 0x112D /*!< SIM Access Profile UUID */ #define ESP_SDP_UUID_DIP 0x1200 /*!< Device Identification Profile UUID */ +/// Build a Bluetooth UUID16 #define ESP_SDP_BUILD_BT_UUID16(uuid16_val) \ (esp_bt_uuid_t) { .len = ESP_UUID_LEN_16, .uuid = {.uuid16 = (uint16_t)(uuid16_val),}, } +/** + * @brief SDP status parameters + */ typedef enum { ESP_SDP_SUCCESS = 0, /*!< Successful operation. */ ESP_SDP_FAILURE, /*!< Generic failure. */ @@ -199,8 +203,8 @@ typedef union { /** * @brief SDP callback function type. * - * @param event: Event type - * @param param: Point to callback parameter, currently is union type + * @param[in] event: Event type + * @param[in] param: Point to callback parameter, currently is union type */ typedef void (* esp_sdp_cb_t)(esp_sdp_cb_event_t event, esp_sdp_cb_param_t *param); @@ -241,7 +245,7 @@ esp_err_t esp_sdp_init(void); esp_err_t esp_sdp_deinit(void); /** - * @brief This function is called to performs service discovery for the services provided by the given peer device. + * @brief Perform service discovery for the services provided by the given peer device. * When the operation is completed, the callback function will be called with ESP_SDP_SEARCH_COMP_EVT. * This function must be called after esp_sdp_init() successful and before esp_sdp_deinit(). * @@ -268,7 +272,7 @@ esp_err_t esp_sdp_search_record(esp_bd_addr_t bd_addr, esp_bt_uuid_t uuid); esp_err_t esp_sdp_create_record(esp_bluetooth_sdp_record_t *record); /** - * @brief This function is called to remove a SDP record. + * @brief Remove an SDP record. * When the operation is completed, the callback function will be called with ESP_SDP_REMOVE_RECORD_COMP_EVT. * This function must be called after esp_sdp_init() successful and before esp_sdp_deinit(). * 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 e6cdf2fc69..f8a9c52403 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -42,15 +42,18 @@ Due to certain limitations, do not use these mask modes: 2. ESP_SPP_SEC_MODE4_LEVEL4 3. ESP_SPP_SEC_MITM */ -#define ESP_SPP_SEC_NONE 0x0000 /*!< No security. relate to BTA_SEC_NONE in bta/bta_api.h */ -#define ESP_SPP_SEC_AUTHORIZE 0x0001 /*!< Authorization required (only needed for out going connection ) relate to BTA_SEC_AUTHORIZE in bta/bta_api.h*/ -#define ESP_SPP_SEC_AUTHENTICATE 0x0012 /*!< Authentication required. relate to BTA_SEC_AUTHENTICATE in bta/bta_api.h*/ -#define ESP_SPP_SEC_ENCRYPT 0x0024 /*!< Encryption required. relate to BTA_SEC_ENCRYPT in bta/bta_api.h*/ -#define ESP_SPP_SEC_MODE4_LEVEL4 0x0040 /*!< Mode 4 level 4 service, i.e. incoming/outgoing MITM and P-256 encryption relate to BTA_SEC_MODE4_LEVEL4 in bta/bta_api.h*/ -#define ESP_SPP_SEC_MITM 0x3000 /*!< Man-In-The_Middle protection relate to BTA_SEC_MITM in bta/bta_api.h*/ -#define ESP_SPP_SEC_IN_16_DIGITS 0x4000 /*!< Min 16 digit for pin code relate to BTA_SEC_IN_16_DIGITS in bta/bta_api.h*/ -typedef uint16_t esp_spp_sec_t; +#define ESP_SPP_SEC_NONE 0x0000 /*!< No security. */ +#define ESP_SPP_SEC_AUTHORIZE 0x0001 /*!< Authorization required (only needed for out going connection ) */ +#define ESP_SPP_SEC_AUTHENTICATE 0x0012 /*!< Authentication required. */ +#define ESP_SPP_SEC_ENCRYPT 0x0024 /*!< Encryption required. */ +#define ESP_SPP_SEC_MODE4_LEVEL4 0x0040 /*!< Mode 4 level 4 service, i.e. incoming/outgoing MITM and P-256 encryption. */ +#define ESP_SPP_SEC_MITM 0x3000 /*!< Man-In-The-Middle protection. */ +#define ESP_SPP_SEC_IN_16_DIGITS 0x4000 /*!< Min 16 digit for pin code. */ +typedef uint16_t esp_spp_sec_t; /*!< SPP security type */ +/** + * @brief SPP status type. + */ typedef enum { ESP_SPP_SUCCESS = 0, /*!< Successful operation. */ ESP_SPP_FAILURE, /*!< Generic failure. */ @@ -63,11 +66,17 @@ typedef enum { ESP_SPP_NO_SERVER, /*!< No SPP server */ } esp_spp_status_t; +/** + * @brief SPP role type. + */ typedef enum { ESP_SPP_ROLE_MASTER = 0, /*!< Role: master */ ESP_SPP_ROLE_SLAVE = 1, /*!< Role: slave */ } esp_spp_role_t; +/** + * @brief SPP mode type. + */ typedef enum { ESP_SPP_MODE_CB = 0, /*!< When data is coming, a callback will come with data */ ESP_SPP_MODE_VFS = 1, /*!< Use VFS to write/read data */ @@ -318,7 +327,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. + * @brief Perform 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(). * diff --git a/docs/en/api-reference/bluetooth/esp_a2dp.rst b/docs/en/api-reference/bluetooth/esp_a2dp.rst index 0bf8f6034c..09d6d8f20c 100644 --- a/docs/en/api-reference/bluetooth/esp_a2dp.rst +++ b/docs/en/api-reference/bluetooth/esp_a2dp.rst @@ -1,8 +1,13 @@ Bluetooth® A2DP API =================== -Application Example -------------------- +Overview +-------- + +A2DP (Advanced Audio Distribution Profile) enables high-quality audio streaming from one device to another over Bluetooth. It is primarily used for streaming audio from source devices such as smartphones, computers, and media players to sink devices such as Bluetooth speakers, headphones, and car audio systems. Users can use the A2DP APIs to transmit or receive audio streams. + +Application Examples +-------------------- Check :example:`bluetooth/bluedroid/classic_bt` folder in ESP-IDF examples, which contains the following application: diff --git a/docs/en/api-reference/bluetooth/esp_avrc.rst b/docs/en/api-reference/bluetooth/esp_avrc.rst index de58565acb..4f8bcb18b9 100644 --- a/docs/en/api-reference/bluetooth/esp_avrc.rst +++ b/docs/en/api-reference/bluetooth/esp_avrc.rst @@ -1,10 +1,10 @@ -Bluetooth® AVRCP APIs -===================== +Bluetooth® AVRCP API +==================== Overview -------- -Bluetooth AVRCP reference APIs. +AVRCP (Audio/Video Remote Control Profile) enables remote control of audio and video devices over Bluetooth, allowing users to manage playback (play, pause, next/previous track), adjust volume, and retrieve media metadata. Application Examples -------------------- diff --git a/docs/en/api-reference/bluetooth/esp_gap_bt.rst b/docs/en/api-reference/bluetooth/esp_gap_bt.rst index c0a84c1f84..f30ef7edab 100644 --- a/docs/en/api-reference/bluetooth/esp_gap_bt.rst +++ b/docs/en/api-reference/bluetooth/esp_gap_bt.rst @@ -1,6 +1,16 @@ -Classic Bluetooth® GAP API +Bluetooth® Classic GAP API ========================== +Overview +-------- + +The Bluetooth Classic GAP (Generic Access Profile) API provides interfaces for device discovery, pairing, and security management, allowing applications to control visibility, initiate connections, and configure authentication and encryption for Bluetooth Classic links. + +Application Examples +-------------------- + +- :example:`bluetooth/bluedroid/classic_bt/bt_discovery` demonstrates how to use APIs to search for a target device with a Major device type of "Phone" or "Audio/Video" in the Class of Device field, and then perform a service discovery via the Service Discovery Protocol. + API Reference ------------- diff --git a/docs/en/api-reference/bluetooth/esp_hf_ag.rst b/docs/en/api-reference/bluetooth/esp_hf_ag.rst index a4dcfff36e..1a83588f46 100644 --- a/docs/en/api-reference/bluetooth/esp_hf_ag.rst +++ b/docs/en/api-reference/bluetooth/esp_hf_ag.rst @@ -1,5 +1,10 @@ -HFP AG API -============== +Bluetooth® HFP AG API +===================== + +Overview +-------- + +HFP (Hands-Free Profile) AG API provides functions for a Bluetooth device to act as an Audio Gateway (AG), enabling communication with HFP Client devices such as headsets or car kits. It supports connection management, call handling, volume control, and other hands-free operations. API Reference ------------- diff --git a/docs/en/api-reference/bluetooth/esp_hf_client.rst b/docs/en/api-reference/bluetooth/esp_hf_client.rst index e08d020035..cb3f520e14 100644 --- a/docs/en/api-reference/bluetooth/esp_hf_client.rst +++ b/docs/en/api-reference/bluetooth/esp_hf_client.rst @@ -1,5 +1,10 @@ -HFP Client API -============== +Bluetooth® HFP Client API +========================= + +Overview +-------- + +HFP (Hands-Free Profile) Client API provides functions to enable a Bluetooth device to act as an HFP Client, allowing communication with an Audio Gateway (AG) device, such as a smartphone, to handle voice calls, volume control, and other hands-free operations. API Reference ------------- diff --git a/docs/en/api-reference/bluetooth/esp_hf_defs.rst b/docs/en/api-reference/bluetooth/esp_hf_defs.rst index 4f9d3f9d2b..400f11a40d 100644 --- a/docs/en/api-reference/bluetooth/esp_hf_defs.rst +++ b/docs/en/api-reference/bluetooth/esp_hf_defs.rst @@ -1,5 +1,17 @@ -HFP Defines -=========== +Bluetooth® HFP Defines +====================== + +Overview +-------- + +This file contains definitions for constants, enumerations, and structures used in the Bluetooth Hands-Free Profile (HFP), enabling features like call management, audio control, and network status reporting. + +Application Examples +-------------------- + +- :example:`bluetooth/bluedroid/classic_bt/hfp_hf` demonstrates how to use the Hands-Free Client Component to communicate with a device that implements Hands-Free Audio Gateway (HF-AG), such as a smartphone. + +- :example:`bluetooth/bluedroid/classic_bt/hfp_ag` demonstrates how to use the Hands-Free Audio Gateway (HF-AG) component to communicate with a device that implements Hands-Free Client Role, such as a headphone set. It provides commands for configuring the project, establishing connections, controlling volume, and answering or rejecting calls. API Reference ------------- diff --git a/docs/en/api-reference/bluetooth/esp_l2cap_bt.rst b/docs/en/api-reference/bluetooth/esp_l2cap_bt.rst index e51fed7205..7065c18a8d 100644 --- a/docs/en/api-reference/bluetooth/esp_l2cap_bt.rst +++ b/docs/en/api-reference/bluetooth/esp_l2cap_bt.rst @@ -1,8 +1,13 @@ -Classic Bluetooth® L2CAP API +Bluetooth® Classic L2CAP API ============================ -Application Example -------------------- +Overview +-------- + +Bluetooth Classic L2CAP (Logical Link Control and Adaptation Layer Protocol) API provides functions for data transmission between Bluetooth devices. It supports both client and server roles, allowing the creation of L2CAP connections for reliable, high-throughput communication. + +Application Examples +-------------------- Check :example:`bluetooth/bluedroid/classic_bt` folder in ESP-IDF examples, which contains the following application: diff --git a/docs/en/api-reference/bluetooth/esp_sdp.rst b/docs/en/api-reference/bluetooth/esp_sdp.rst index 75a893731e..3bd53c2423 100644 --- a/docs/en/api-reference/bluetooth/esp_sdp.rst +++ b/docs/en/api-reference/bluetooth/esp_sdp.rst @@ -1,10 +1,17 @@ -Bluetooth® SDP APIs -=================== +Bluetooth® SDP API +================== Overview -------- -Bluetooth SDP reference APIs. +SDP (Service Discovery Protocol) API enables devices to discover services and service attributes offered by remote Bluetooth devices. It supports service search, service attribute retrieval, and the establishment of service connections. + +Application Examples +-------------------- + +- :example:`bluetooth/bluedroid/classic_bt/bt_l2cap_client` demonstrates how to use SDP APIs to search for services on remote Bluetooth devices. It shows how to register SDP callbacks, initialize SDP, perform service discovery using ``esp_sdp_search_record()``, and retrieve the L2CAP PSM (Protocol/Service Multiplexer) value from the search results to establish an L2CAP connection. + +- :example:`bluetooth/bluedroid/classic_bt/bt_l2cap_server` demonstrates how to use SDP APIs to create and publish service records. It shows how to register SDP callbacks, initialize SDP, create an SDP record using ``esp_sdp_create_record()`` with L2CAP PSM information, making the service discoverable by remote clients. API Reference ------------- diff --git a/docs/en/api-reference/bluetooth/esp_spp.rst b/docs/en/api-reference/bluetooth/esp_spp.rst index aad387d261..485e9895ab 100644 --- a/docs/en/api-reference/bluetooth/esp_spp.rst +++ b/docs/en/api-reference/bluetooth/esp_spp.rst @@ -1,5 +1,10 @@ -SPP API -======= +Bluetooth® SPP API +================== + +Overview +-------- + +SPP (Serial Port Profile) enables serial communication between Bluetooth devices, allowing them to exchange data over a virtual serial link. SPP API provides functionality to create both SPP initiators (clients) and acceptors (servers), enabling operation under different security requirements. Application Example -------------------