From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ v1 2/2] eir: Use Broadcast Name as Device.Name
Date: Mon, 21 Apr 2025 17:06:02 -0400 [thread overview]
Message-ID: <20250421210602.746957-2-luiz.dentz@gmail.com> (raw)
In-Reply-To: <20250421210602.746957-1-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This makes use of Broadcast Name advertising data field as device name
so it can be identified by upper layer.
---
src/eir.c | 3 ++-
src/eir.h | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/eir.c b/src/eir.c
index 3e3ee2863058..28b09653cbae 100644
--- a/src/eir.c
+++ b/src/eir.c
@@ -293,6 +293,7 @@ void eir_parse(struct eir_data *eir, const uint8_t *eir_data, uint8_t eir_len)
case EIR_NAME_SHORT:
case EIR_NAME_COMPLETE:
+ case EIR_BC_NAME:
/* Some vendors put a NUL byte terminator into
* the name */
while (data_len > 0 && data[data_len - 1] == '\0')
@@ -301,7 +302,7 @@ void eir_parse(struct eir_data *eir, const uint8_t *eir_data, uint8_t eir_len)
g_free(eir->name);
eir->name = name2utf8(data, data_len);
- eir->name_complete = eir_data[1] == EIR_NAME_COMPLETE;
+ eir->name_complete = eir_data[1] != EIR_NAME_SHORT;
break;
case EIR_TX_POWER:
diff --git a/src/eir.h b/src/eir.h
index f34291952823..2fe8cddf783d 100644
--- a/src/eir.h
+++ b/src/eir.h
@@ -39,6 +39,7 @@
#define EIR_SVC_DATA128 0x21 /* LE: Service data, 128-bit UUID */
#define EIR_TRANSPORT_DISCOVERY 0x26 /* Transport Discovery Service */
#define EIR_CSIP_RSI 0x2e /* Resolvable Set Identifier */
+#define EIR_BC_NAME 0x30 /* Broadcast Name */
#define EIR_MANUFACTURER_DATA 0xFF /* Manufacturer Specific Data */
/* Flags Descriptions */
--
2.49.0
next prev parent reply other threads:[~2025-04-21 21:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-21 21:06 [PATCH BlueZ v1 1/2] btmon: Decode Broadcast Name Luiz Augusto von Dentz
2025-04-21 21:06 ` Luiz Augusto von Dentz [this message]
2025-04-22 13:40 ` patchwork-bot+bluetooth
2025-04-24 15:45 ` [BlueZ,v1,1/2] " bluez.test.bot
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=20250421210602.746957-2-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.