docs(bt): update Classic Bluetooth api reference of SDP

This commit is contained in:
yangfeng
2025-12-10 16:54:41 +08:00
parent b32f703d87
commit 74fa9f7945
2 changed files with 18 additions and 7 deletions

View File

@@ -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. */
@@ -231,8 +235,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);
@@ -273,7 +277,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().
*
@@ -300,7 +304,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().
*

View File

@@ -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
-------------