From f67b72b4cc39eb14748914a1293c33cbe5517f3d Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 12 Nov 2025 16:08:51 -0500 Subject: [PATCH] monitor: Add page information to print_features_subpage This makes print_features_subpage print the page they belong: > HCI Event: Command Complete (0x0e) plen 253 LE Read All Local Features (0x08|0x0087) ncmd 1 Status: Success (0x00) Page: 10 Features[0/0][8]: 403900f301000080 LL Privacy LE 2M PHY LE Coded PHY LE Extended Advertising LE Periodic Advertising Periodic Advertising Sync Transfer - Sender Periodic Advertising Sync Transfer - Recipient Connected Isochronous Stream - Central Connected Isochronous Stream - Peripheral Isochronous Broadcaster Synchronized Receiver Connected Isochronous Stream (Host Support) LL Extended Feature Set Features[1/0][8]: 0000000000000000 Features[1/1][8]: 0000000000000000 Features[1/2][8]: 0000000000000000 Features[2/0][8]: 0000000000000000 Features[2/1][8]: 0000000000000000 Features[2/2][8]: 0000000000000000 Features[3/0][8]: 0000000000000000 Features[3/1][8]: 0000000000000000 Features[3/2][8]: 0000000000000000 Features[4/0][8]: 0000000000000000 Features[4/1][8]: 0000000000000000 Features[4/2][8]: 0000000000000000 Features[5/0][8]: 0000000000000000 Features[5/1][8]: 0000000000000000 Features[5/2][8]: 0000000000000000 Features[6/0][8]: 0000000000000000 Features[6/1][8]: 0000000000000000 Features[6/2][8]: 0000000000000000 Features[7/0][8]: 0000000000000000 Features[7/1][8]: 0000000000000000 Features[7/2][8]: 0000000000000000 Features[8/0][8]: 0000000000000000 Features[8/1][8]: 0000000000000000 Features[8/2][8]: 0000000000000000 Features[9/0][8]: 0000000000000000 Features[9/1][8]: 0000000000000000 Features[9/2][8]: 0000000000000000 Features[10/0][8]: 0000000000000000 Features[10/1][8]: 0000000000000000 Features[10/2][8]: 0000000000000000 --- monitor/packet.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/monitor/packet.c b/monitor/packet.c index 06c0894d8..2ae4f8fff 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -2837,18 +2837,18 @@ static const struct bitfield_data features_msft[] = { { } }; -static void print_features_subpage(uint8_t subpages, +static void print_features_subpage(uint8_t page, uint8_t subpages, const uint8_t *features_array, uint64_t *features) { int i, j; - char str[16]; + char str[18]; for (i = 0; i < subpages; i++) { for (j = 0; j < 8; j++) features[i] |= ((uint64_t) features_array[i * 8 + j]) << (j * 8); - sprintf(str, "Features[%u]", i); + sprintf(str, "Features[%u/%u]", page, i); print_hex_field(str, &features_array[i * 8], 8); } } @@ -2865,7 +2865,7 @@ static void print_features(uint8_t page, const uint8_t *features_array, if (type == 0x01 && page) subpages = 3; - print_features_subpage(subpages, features_array, features); + print_features_subpage(page, subpages, features_array, features); switch (type) { case 0x00: -- 2.47.3