diff mbox series

[BlueZ,v1,1/2] btmon: Decode Broadcast Name

Message ID 20250421210602.746957-1-luiz.dentz@gmail.com
State New
Headers show
Series [BlueZ,v1,1/2] btmon: Decode Broadcast Name | expand

Commit Message

Luiz Augusto von Dentz April 21, 2025, 9:06 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This adds support for decoding Broadcast Name:

> 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(+)

Comments

patchwork-bot+bluetooth@kernel.org April 22, 2025, 1:40 p.m. UTC | #1
Hello:

This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Mon, 21 Apr 2025 17:06:01 -0400 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> This adds support for decoding Broadcast Name:
> 
> > 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
> 
> [...]

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!
diff mbox series

Patch

diff --git a/monitor/packet.c b/monitor/packet.c
index 15f741c61489..ebd095ab9056 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -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;