From e2915a60c55812e83bab1a7c8703dd9578e599fa Mon Sep 17 00:00:00 2001 From: Zhang Hai Peng Date: Tue, 13 May 2025 16:14:09 +0800 Subject: [PATCH] fix(ble/bluedroid): Change maximum length of attribute value to 517 (cherry picked from commit df8c1f7a96a42010349171819ba984916b997db2) Co-authored-by: zhanghaipeng --- components/bt/host/bluedroid/api/include/api/esp_gatt_defs.h | 2 +- components/bt/host/bluedroid/stack/include/stack/gatt_api.h | 2 +- 2 files changed, 2 insertions(+), 2 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 f6beb5eaae..e8cc134ca7 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 512 /*!< As same as GATT_MAX_ATTR_LEN. */ +#define ESP_GATT_MAX_ATTR_LEN 517 /*!< 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 fed2ea9a4e..6c63db6238 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 512 +#define GATT_MAX_ATTR_LEN GATT_MAX_MTU_SIZE #endif /* default GATT MTU size over LE link