Skip to content

Commit 26a1b69

Browse files
committed
Merge branch 'feat/add_sdk_config_for_sdp_size_option' into 'master'
feat(bt): Implement SDK Config SDP Size Options See merge request espressif/esp-idf!36873
2 parents 1bfc6ed + 57a52f5 commit 26a1b69

File tree

3 files changed

+37
-2
lines changed

3 files changed

+37
-2
lines changed

components/bt/host/bluedroid/Kconfig.in

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,26 @@ config BT_SDP_COMMON_ENABLED
132132
help
133133
This enables common SDP operation, such as SDP record creation and deletion.
134134

135+
config BT_SDP_PAD_LEN
136+
int "One or more BT SDP attributes total allocated length (bytes)"
137+
depends on BT_CLASSIC_ENABLED
138+
default 300
139+
range BT_SDP_ATTR_LEN 1024
140+
help
141+
This is the total size of all SDP attributes allowed.
142+
Any attributes that exceed this size are truncated.
143+
The default value is 300.
144+
145+
config BT_SDP_ATTR_LEN
146+
int "Single BT SDP attribute allocated length (bytes)"
147+
depends on BT_CLASSIC_ENABLED
148+
default 300
149+
range 300 1024
150+
help
151+
This is the maximum allowed size for a single SDP attribute.
152+
Any attributes that exceed this size are truncated.
153+
The default value is 300.
154+
135155
menuconfig BT_HFP_ENABLE
136156
bool "Hands Free/Handset Profile"
137157
depends on BT_CLASSIC_ENABLED

components/bt/host/bluedroid/common/include/common/bluedroid_user_config.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,20 @@
7373
#define UC_BT_SDP_COMMON_ENABLED FALSE
7474
#endif
7575

76+
// SDP Pad Length
77+
#ifdef CONFIG_BT_SDP_PAD_LEN
78+
#define UC_SDP_MAX_PAD_LEN CONFIG_BT_SDP_PAD_LEN
79+
#else
80+
#define UC_SDP_MAX_PAD_LEN 300
81+
#endif
82+
83+
// SDP Max Attribute Length
84+
#ifdef CONFIG_BT_SDP_ATTR_LEN
85+
#define UC_SDP_MAX_ATTR_LEN CONFIG_BT_SDP_ATTR_LEN
86+
#else
87+
#define UC_SDP_MAX_ATTR_LEN 300
88+
#endif
89+
7690
//HFP(AG)
7791
#ifdef CONFIG_BT_HFP_AG_ENABLE
7892
#define UC_BT_HFP_AG_ENABLED CONFIG_BT_HFP_AG_ENABLE

components/bt/host/bluedroid/common/include/common/bt_target.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1666,13 +1666,14 @@
16661666
#endif /* defined(HID_DEV_INCLUDED) && (HID_DEV_INCLUDED==TRUE) */
16671667
#endif
16681668

1669+
/* The maximum length, in bytes, of all SDP attributes combined. */
16691670
#ifndef SDP_MAX_PAD_LEN
1670-
#define SDP_MAX_PAD_LEN 300
1671+
#define SDP_MAX_PAD_LEN UC_SDP_MAX_PAD_LEN
16711672
#endif
16721673

16731674
/* The maximum length, in bytes, of an attribute. */
16741675
#ifndef SDP_MAX_ATTR_LEN
1675-
#define SDP_MAX_ATTR_LEN 400
1676+
#define SDP_MAX_ATTR_LEN UC_SDP_MAX_ATTR_LEN
16761677
#endif
16771678

16781679
/* The maximum number of attribute filters supported by SDP databases. */

0 commit comments

Comments
 (0)