From 182cbb85f890004127dafa5f5ffaf0f2f73c696e Mon Sep 17 00:00:00 2001 From: zhanghaipeng Date: Wed, 10 Apr 2024 19:41:46 +0800 Subject: [PATCH] fix(ble/bluedroid): Fixed BLE GATT max length of an attribute value --- .../bt/host/bluedroid/api/include/api/esp_gatt_defs.h | 2 +- .../bt/host/bluedroid/stack/include/stack/gatt_api.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/components/bt/host/bluedroid/api/include/api/esp_gatt_defs.h b/components/bt/host/bluedroid/api/include/api/esp_gatt_defs.h index d9c36e0b4e..77f03e8bf3 100644 --- a/components/bt/host/bluedroid/api/include/api/esp_gatt_defs.h +++ b/components/bt/host/bluedroid/api/include/api/esp_gatt_defs.h @@ -478,7 +478,7 @@ typedef uint8_t esp_gatt_char_prop_t; * * This definition specifies the maximum number of bytes that a GATT attribute can hold. */ -#define ESP_GATT_MAX_ATTR_LEN 600 /*!< As same as GATT_MAX_ATTR_LEN. */ +#define ESP_GATT_MAX_ATTR_LEN 512 /*!< As same as GATT_MAX_ATTR_LEN. */ /** * @brief Enumerates the possible sources of a GATT service discovery. diff --git a/components/bt/host/bluedroid/stack/include/stack/gatt_api.h b/components/bt/host/bluedroid/stack/include/stack/gatt_api.h index 7872e139b5..fed2ea9a4e 100644 --- a/components/bt/host/bluedroid/stack/include/stack/gatt_api.h +++ b/components/bt/host/bluedroid/stack/include/stack/gatt_api.h @@ -139,7 +139,7 @@ typedef UINT16 tGATT_DISCONN_REASON; /* max length of an attribute value */ #ifndef GATT_MAX_ATTR_LEN -#define GATT_MAX_ATTR_LEN 600 +#define GATT_MAX_ATTR_LEN 512 #endif /* default GATT MTU size over LE link @@ -701,7 +701,7 @@ extern UINT8 GATT_SetTraceLevel (UINT8 new_level); ** ** Function GATTS_AddHandleRange ** -** Description This function add the allocated handles range for the specifed +** Description This function add the allocated handles range for the specified ** application UUID, service UUID and service instance ** ** Parameter p_hndl_range: pointer to allocated handles information @@ -720,7 +720,7 @@ extern BOOLEAN GATTS_AddHandleRange(tGATTS_HNDL_RANGE *p_hndl_range); ** NV save callback function. There can be one and only one ** NV save callback function. ** -** Parameter p_cb_info : callback informaiton +** Parameter p_cb_info : callback information ** ** Returns TRUE if registered OK, else FALSE ** @@ -1143,7 +1143,7 @@ extern BOOLEAN GATT_Connect (tGATT_IF gatt_if, BD_ADDR bd_addr, tBLE_ADDR_TYPE b ** ** Function GATT_CancelConnect ** -** Description This function terminate the connection initaition to a remote +** Description This function terminate the connection initiation to a remote ** device on GATT channel. ** ** Parameters gatt_if: client interface. If 0 used as unconditionally disconnect,