From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ v1] src/shared: Make default length handle EA
Date: Wed, 1 May 2024 15:28:12 -0400 [thread overview]
Message-ID: <20240501192812.3421949-1-luiz.dentz@gmail.com> (raw)
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
By default bt_ad was setting just BT_AD_MAX_DATA_LEN (31) which is not
enough to handle devices advertising using EA, so this switches the
default to be BT_EA_MAX_DATA_LEN (251) since EA is much more common
nowadays and for those case where the it is not supported (e.g. for
advertisers without EA support) then shall be using bt_ad_set_max_len
to adjust the maximum length.
Fixes: https://github.com/bluez/bluez/issues/832
---
src/shared/ad.c | 2 +-
src/shared/ad.h | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/shared/ad.c b/src/shared/ad.c
index 2d6fc628eabc..f3fb428e25c6 100644
--- a/src/shared/ad.c
+++ b/src/shared/ad.c
@@ -48,7 +48,7 @@ struct bt_ad *bt_ad_new(void)
struct bt_ad *ad;
ad = new0(struct bt_ad, 1);
- ad->max_len = BT_AD_MAX_DATA_LEN;
+ ad->max_len = BT_EA_MAX_DATA_LEN;
ad->service_uuids = queue_new();
ad->manufacturer_data = queue_new();
ad->solicit_uuids = queue_new();
diff --git a/src/shared/ad.h b/src/shared/ad.h
index 820b9177562b..11900706f9ed 100644
--- a/src/shared/ad.h
+++ b/src/shared/ad.h
@@ -15,6 +15,7 @@
#include "lib/uuid.h"
#define BT_AD_MAX_DATA_LEN 31
+#define BT_EA_MAX_DATA_LEN 251
#define BT_PA_MAX_DATA_LEN 252
#define BT_AD_FLAGS 0x01
--
2.44.0
next reply other threads:[~2024-05-01 19:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-01 19:28 Luiz Augusto von Dentz [this message]
2024-05-01 21:04 ` [BlueZ,v1] src/shared: Make default length handle EA bluez.test.bot
2024-05-02 14:40 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240501192812.3421949-1-luiz.dentz@gmail.com \
--to=luiz.dentz@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).