btmon: Decode Broadcast Name
Luiz Augusto von Dentz
maintainerPATCH 1/2 btmon: Decode Broadcast Name
From: Luiz Augusto von Dentz <[email protected]>
This adds support for decoding Broadcast Name:
Quoted 1 line
HCI Event: LE Meta Event (
0x3e) plen 57
LE Extended Advertising Report (0x0d)
Num reports: 1
Entry 0
Event type: 0x0000
Props: 0x0000
Data status: Complete
Address type: Random (0x01)
Address: XX:XX:XX:XX:XX:XX (Non-Resolvable)
Primary PHY: LE 1M
Secondary PHY: LE 2M
SID: 0x02
TX power: 127 dBm
RSSI: -67 dBm (0xbd)
Periodic advertising interval: 180.00 msec (0x0090)
Direct address type: Public (0x00)
Direct address: 00:00:00:00:00:00 (OUI 00-00-00)
Data length: 0x1f
06 16 52 18 2f 92 f3 05 16 56 18 04 00 11 30 4c ..R./....V....0L
75 69 7a 27 73 20 53 32 33 20 55 6c 74 72 61 uiz's S23 Ultra
Service Data: Broadcast Audio Announcement (0x1852)
Broadcast ID: 15962671 (0xf3922f)
Service Data: Public Broadcast Announcement (0x1856)
Data[2]: 0400
Broadcast Name: Luiz's S23 Ultra
---
monitor/packet.c | 7 +++++++
1 file changed, 7 insertions(+)monitor/packet.c +7 -0
@@ -3213,6 +3213,7 @@ static void print_fec(uint8_t fec)#define BT_EIR_MESH_DATA 0x2a#define BT_EIR_MESH_BEACON 0x2b#define BT_EIR_CSIP_RSI 0x2e +#define BT_EIR_BC_NAME 0x30#define BT_EIR_3D_INFO_DATA 0x3d#define BT_EIR_MANUFACTURER_DATA 0xff
@@ -4058,6 +4059,12 @@ static void print_eir(const uint8_t *eir, uint8_t eir_len, bool le)print_field (" Random: 0x%6x" ,get_le24 (data +3 ));break ; +case BT_EIR_BC_NAME : +memset (name,0 ,sizeof (name)); +memcpy (name, data, data_len); +print_field ("Broadcast Name: %s" , name); +break ; +case BT_EIR_MANUFACTURER_DATA :if (data_len <2 )break ;
Signature · 1 line
2.49.0
Luiz Augusto von Dentz
maintainerPATCH 2/2 eir: Use Broadcast Name as Device.Name
From: Luiz Augusto von Dentz <[email protected]>
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(-)
src/eir.c +2 -1
@@ -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 :
src/eir.h +1 -0
@@ -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 */
Signature · 1 line
2.49.0
This series was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:
Hello:
This series was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:
Quoted 30 lines · On Mon, 21 Apr 2025 17:06:01 -0400 you wrote:
From: Luiz Augusto von Dentz <[email protected]>
This adds support for decoding Broadcast Name:
Quoted 1 line
HCI Event: LE Meta Event (
0x3e) plen 57LE Extended Advertising Report (0x0d) Num reports: 1 Entry 0 Event type: 0x0000 Props: 0x0000 Data status: Complete Address type: Random (0x01) Address: XX:XX:XX:XX:XX:XX (Non-Resolvable) Primary PHY: LE 1M Secondary PHY: LE 2M SID: 0x02 TX power: 127 dBm RSSI: -67 dBm (0xbd) Periodic advertising interval: 180.00 msec (0x0090) Direct address type: Public (0x00) Direct address: 00:00:00:00:00:00 (OUI 00-00-00) Data length: 0x1f 06 16 52 18 2f 92 f3 05 16 56 18 04 00 11 30 4c ..R./....V....0L 75 69 7a 27 73 20 53 32 33 20 55 6c 74 72 61 uiz's S23 Ultra Service Data: Broadcast Audio Announcement (0x1852) Broadcast ID: 15962671 (0xf3922f) Service Data: Public Broadcast Announcement (0x1856) Data[2]: 0400 Broadcast Name: Luiz's S23 Ultra
Quoted 1 line
[...]
Here is the summary with links:
- [BlueZ,v1,1/2] btmon: Decode Broadcast Name
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=99deeea86f15 - [BlueZ,v1,2/2] eir: Use Broadcast Name as Device.Name https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=e4c1d03ef73c
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
This is an automated email and please do not reply to this email.
Dear Submitter,
Thank you for submitting the patches to the linux bluetooth mailing list.
While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository.
----- Output -----
error: patch failed: monitor/packet.c:3213
error: monitor/packet.c: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch
Please resolve the issue and submit the patches again.
---
Regards,
Linux Bluetooth