diff --git a/components/bt/host/bluedroid/Kconfig.in b/components/bt/host/bluedroid/Kconfig.in index 6fb1d3d219..11eda2002d 100644 --- a/components/bt/host/bluedroid/Kconfig.in +++ b/components/bt/host/bluedroid/Kconfig.in @@ -103,6 +103,26 @@ config BT_L2CAP_ENABLED This enables the Logical Link Control and Adaptation Layer Protocol. Only supported classic bluetooth. +config BT_SDP_PAD_LEN + int "One or more BT SDP attributes total allocated length (bytes)" + depends on BT_CLASSIC_ENABLED + default 300 + range BT_SDP_ATTR_LEN 1024 + help + This is the total size of all SDP attributes allowed. + Any attributes that exceed this size are truncated. + The default value is 300. + +config BT_SDP_ATTR_LEN + int "Single BT SDP attribute allocated length (bytes)" + depends on BT_CLASSIC_ENABLED + default 300 + range 300 1024 + help + This is the maximum allowed size for a single SDP attribute. + Any attributes that exceed this size are truncated. + The default value is 300. + menuconfig BT_HFP_ENABLE bool "Hands Free/Handset Profile" depends on BT_CLASSIC_ENABLED diff --git a/components/bt/host/bluedroid/common/include/common/bluedroid_user_config.h b/components/bt/host/bluedroid/common/include/common/bluedroid_user_config.h index 17aeeae857..e0a42039d6 100644 --- a/components/bt/host/bluedroid/common/include/common/bluedroid_user_config.h +++ b/components/bt/host/bluedroid/common/include/common/bluedroid_user_config.h @@ -53,6 +53,20 @@ #define UC_BT_L2CAP_ENABLED FALSE #endif +// SDP Pad Length +#ifdef CONFIG_BT_SDP_PAD_LEN +#define UC_SDP_MAX_PAD_LEN CONFIG_BT_SDP_PAD_LEN +#else +#define UC_SDP_MAX_PAD_LEN 300 +#endif + +// SDP Max Attribute Length +#ifdef CONFIG_BT_SDP_ATTR_LEN +#define UC_SDP_MAX_ATTR_LEN CONFIG_BT_SDP_ATTR_LEN +#else +#define UC_SDP_MAX_ATTR_LEN 300 +#endif + //HFP(AG) #ifdef CONFIG_BT_HFP_AG_ENABLE #define UC_BT_HFP_AG_ENABLED CONFIG_BT_HFP_AG_ENABLE diff --git a/components/bt/host/bluedroid/common/include/common/bt_target.h b/components/bt/host/bluedroid/common/include/common/bt_target.h index a3367fb346..06c12504b4 100644 --- a/components/bt/host/bluedroid/common/include/common/bt_target.h +++ b/components/bt/host/bluedroid/common/include/common/bt_target.h @@ -1518,13 +1518,14 @@ #endif /* defined(HID_DEV_INCLUDED) && (HID_DEV_INCLUDED==TRUE) */ #endif +/* The maximum length, in bytes, of all SDP attributes combined. */ #ifndef SDP_MAX_PAD_LEN -#define SDP_MAX_PAD_LEN 300 +#define SDP_MAX_PAD_LEN UC_SDP_MAX_PAD_LEN #endif /* The maximum length, in bytes, of an attribute. */ #ifndef SDP_MAX_ATTR_LEN -#define SDP_MAX_ATTR_LEN 400 +#define SDP_MAX_ATTR_LEN UC_SDP_MAX_ATTR_LEN #endif /* The maximum number of attribute filters supported by SDP databases. */