Skip to content

Commit 57a52f5

Browse files
committed
change(bt): optimize the macro definition for sdp_max_pad_len
1 parent 0d7b0c8 commit 57a52f5

File tree

3 files changed

+15
-19
lines changed

3 files changed

+15
-19
lines changed

components/bt/host/bluedroid/Kconfig.in

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -133,24 +133,24 @@ config BT_SDP_COMMON_ENABLED
133133
This enables common SDP operation, such as SDP record creation and deletion.
134134

135135
config BT_SDP_PAD_LEN
136-
int "BT SDP attributes allocated length (bytes)"
136+
int "One or more BT SDP attributes total allocated length (bytes)"
137137
depends on BT_CLASSIC_ENABLED
138138
default 300
139-
range 300 1024
139+
range BT_SDP_ATTR_LEN 1024
140140
help
141-
This is the total size of all SDP attributes allowed.
142-
Any attributes that exceed this size are truncated.
141+
This is the total size of all SDP attributes allowed.
142+
Any attributes that exceed this size are truncated.
143143
The default value is 300.
144144

145145
config BT_SDP_ATTR_LEN
146-
int "BT SDP attribute allocated length (bytes)"
146+
int "Single BT SDP attribute allocated length (bytes)"
147147
depends on BT_CLASSIC_ENABLED
148-
default 400
149-
range 400 1024
148+
default 300
149+
range 300 1024
150150
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 400.
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.
154154

155155
menuconfig BT_HFP_ENABLE
156156
bool "Hands Free/Handset Profile"

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@
7676
// SDP Pad Length
7777
#ifdef CONFIG_BT_SDP_PAD_LEN
7878
#define UC_SDP_MAX_PAD_LEN CONFIG_BT_SDP_PAD_LEN
79-
#else
79+
#else
8080
#define UC_SDP_MAX_PAD_LEN 300
8181
#endif
8282

8383
// SDP Max Attribute Length
8484
#ifdef CONFIG_BT_SDP_ATTR_LEN
8585
#define UC_SDP_MAX_ATTR_LEN CONFIG_BT_SDP_ATTR_LEN
86-
#else
87-
#define UC_SDP_MAX_ATTR_LEN 400
86+
#else
87+
#define UC_SDP_MAX_ATTR_LEN 300
8888
#endif
8989

9090
//HFP(AG)

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1659,17 +1659,13 @@
16591659
#endif
16601660

16611661
/* The maximum length, in bytes, of all SDP attributes combined. */
1662-
#if defined(UC_SDP_MAX_PAD_LEN)
1662+
#ifndef SDP_MAX_PAD_LEN
16631663
#define SDP_MAX_PAD_LEN UC_SDP_MAX_PAD_LEN
1664-
#elif !defined(SDP_MAX_PAD_LEN)
1665-
#define SDP_MAX_PAD_LEN 300
16661664
#endif
16671665

16681666
/* The maximum length, in bytes, of an attribute. */
1669-
#if defined(UC_SDP_MAX_ATTR_LEN)
1667+
#ifndef SDP_MAX_ATTR_LEN
16701668
#define SDP_MAX_ATTR_LEN UC_SDP_MAX_ATTR_LEN
1671-
#elif !defined(SDP_MAX_ATTR_LEN)
1672-
#define SDP_MAX_ATTR_LEN 400
16731669
#endif
16741670

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

0 commit comments

Comments
 (0)