Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ v1] monitor: Decode Intel DDC LE extended features
@ 2026-07-30 17:51 Luiz Augusto von Dentz
  2026-07-30 19:45 ` [BlueZ,v1] " bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Luiz Augusto von Dentz @ 2026-07-30 17:51 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

The Intel DDC Config Write command (0x3f|0x008b) can carry identifier
0x031f which holds the 248 octet LE extended features array, using the
same layout as LE Read All Local Features: page 0 is 8 octets followed
by 10 pages of 24 octets each.

Decode it with the existing LE feature tables instead of dumping raw
hex, and make the parameter loop stop on truncated/padded entries.

Example, setting only the SCI bits on page 1 (bits 8 and 9):

  hcitool cmd 0x3F 0x008B 0xFA 0x1F 0x03 \
      0xFF 0xF9 0x01 0x3F 0xBE 0x00 0x00 0x80 \
      0x00 0x03 0x00 0x00 ... (padding up to 248 octets)

  < HCI Command: Intel DDC Config Write (0x3f|0x008b) plen 251
          Identifier: 0x031f
          Features[0/0][8]:
          ff f9 01 3f be 00 00 80                          ...?....
            LE Encryption
            Connection Parameter Request Procedure
            ...
            LL Extended Feature Set
          Features[1/0][8]:
          00 03 00 00 00 00 00 00                          ........
            Shorter Connection Intervals
            Shorter Connection Intervals (Host Support)
          Features[1/1][8]:
          00 00 00 00 00 00 00 00                          ........
          ...
---
 monitor/intel.c | 33 +++++++++++++++++++++++++++++++--
 1 file changed, 31 insertions(+), 2 deletions(-)

diff --git a/monitor/intel.c b/monitor/intel.c
index cd997d24b59c..782fda675422 100644
--- a/monitor/intel.c
+++ b/monitor/intel.c
@@ -681,14 +681,43 @@ static void set_event_mask_cmd(uint16_t index, const void *data, uint8_t size)
 						"(0x%16.16" PRIx64 ")", mask);
 }
 
+#define DDC_ID_LE_EXT_FEATURES	0x031f
+
+/* LE extended features: page 0 is 8 octets, pages 1-10 are 24 octets each */
+static void print_ddc_le_ext_features(const uint8_t *features, uint8_t len)
+{
+	uint8_t i;
+
+	if (len < 8) {
+		packet_hexdump(features, len);
+		return;
+	}
+
+	packet_print_features_ext_ll(0, features);
+
+	for (i = 0; i < 10 && len >= 8 + (i + 1) * 24; i++)
+		packet_print_features_ext_ll(i + 1, features + 8 + i * 24);
+}
+
 static void ddc_config_write_cmd(uint16_t index, const void *data, uint8_t size)
 {
-	while (size > 0) {
+	while (size > 2) {
 		uint8_t param_len = get_u8(data);
 		uint16_t param_id = get_le16(data + 1);
 
+		if (param_len < 2 || param_len + 1 > size)
+			break;
+
 		print_field("Identifier: 0x%4.4x", param_id);
-		packet_hexdump(data + 3, param_len - 2);
+
+		switch (param_id) {
+		case DDC_ID_LE_EXT_FEATURES:
+			print_ddc_le_ext_features(data + 3, param_len - 2);
+			break;
+		default:
+			packet_hexdump(data + 3, param_len - 2);
+			break;
+		}
 
 		data += param_len + 1;
 		size -= param_len + 1;
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-30 19:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-30 17:51 [PATCH BlueZ v1] monitor: Decode Intel DDC LE extended features Luiz Augusto von Dentz
2026-07-30 19:45 ` [BlueZ,v1] " bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox