docs(bt): clarify GATT client auth_req may trigger SMP

(cherry picked from commit 43734e7d7b)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
This commit is contained in:
Zhang Hai Peng
2026-06-02 10:23:26 +08:00
parent 8caed9e760
commit e4bb039f41
2 changed files with 12 additions and 5 deletions

View File

@@ -361,10 +361,15 @@ typedef struct {
/**
* @brief Defines the GATT authentication request types.
*
* This enumeration lists the types of authentication requests that can be made.
* It corresponds to the `BTA_GATT_AUTH_REQ_xxx` values defined in `bta/bta_gatt_api.h`.
* The types include options for no authentication, unauthenticated encryption, authenticated encryption,
* and both signed versions with and without MITM (Man-In-The-Middle) protection.
* Used as the `auth_req` argument in GATT client read/write APIs. It specifies the
* link security level required before the ATT request is sent, and is independent
* of server-side attribute permission flags (`ESP_GATT_PERM_xxx`).
*
* @note If `auth_req` is not `ESP_GATT_AUTH_REQ_NONE`, the stack may start link
* encryption or SMP pairing before the GATT operation. Handle
* `ESP_GAP_BLE_PASSKEY_REQ_EVT` and call `esp_ble_passkey_reply()` if needed.
*
* Corresponds to the `BTA_GATT_AUTH_REQ_xxx` values defined in `bta/bta_gatt_api.h`.
*/
typedef enum {
ESP_GATT_AUTH_REQ_NONE = 0, /*!< No authentication required. Corresponds to BTA_GATT_AUTH_REQ_NONE. */

View File

@@ -874,12 +874,14 @@ esp_err_t esp_ble_gattc_read_char_descr (esp_gatt_if_t gattc_if,
* @param[in] value_len The length of the value to write in bytes
* @param[in] value The value to write
* @param[in] write_type The type of Attribute write operation
* @param[in] auth_req Authentication request type
* @param[in] auth_req Authenticate request type
*
* @note
* 1. This function triggers `ESP_GATTC_WRITE_CHAR_EVT`.
* 2. This function should be called only after the connection has been established.
* 3. `handle` must be greater than 0.
* 4. If `auth_req` is not `ESP_GATT_AUTH_REQ_NONE`, the stack may start encryption
* or SMP pairing before sending the ATT write.
*
* @return
* - ESP_OK: Success