From: Roland Schober <rolandschober1968@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Roland Schober <rolandschober1968@gmail.com>
Subject: [PATCH BlueZ v4 07/10] monitor: Fix byte order of LE PA Sync Handle and Properties
Date: Fri, 20 Nov 2026 07:38:53 +0100 [thread overview]
Message-ID: <20261120063856.16585-8-rolandschober1968@gmail.com> (raw)
In-Reply-To: <20261120063856.16585-1-rolandschober1968@gmail.com>
The decoders of the LE Periodic Advertising Sync Established and
LE Periodic Advertising Report events print the Sync_Handle, and the
decoder of LE Set Periodic Advertising Parameters prints the
Periodic_Advertising_Properties, as they are stored in the packet.
On a big-endian host Sync_Handle 2 is therefore shown as 512, and the
Include TxPower property (0x0040) as unknown property 0x4000.
Convert them from little-endian like the other fields.
Fixes: 9285a4e33882 ("monitor: Decode LE Periodic Advertising Sync Established Event")
Fixes: 5441a5b91a08 ("monitor: Decode LE Periodic Advertising Report Event")
Fixes: 61563bd7b477 ("monitor: Add LE Set Periodic Advertising commands decoding")
Assisted-by: Claude:claude-fable-5-2
---
monitor/packet.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/monitor/packet.c b/monitor/packet.c
index ce05928c1..4b7a82ac0 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -8707,7 +8707,7 @@ static void le_set_pa_params_cmd(uint16_t index, const void *data, uint8_t size)
print_field("Handle: 0x%2.2x", cmd->handle);
print_slot_125("Min interval", cmd->min_interval);
print_slot_125("Max interval", cmd->max_interval);
- print_pa_properties(cmd->properties);
+ print_pa_properties(le16_to_cpu(cmd->properties));
}
static void le_set_pa_data_cmd(uint16_t index, const void *data, uint8_t size)
@@ -13904,7 +13904,7 @@ static void le_pa_sync_evt(struct timeval *tv, uint16_t index,
const struct bt_hci_evt_le_per_sync_established *evt = data;
print_status(evt->status);
- print_field("Sync handle: %d", evt->handle);
+ print_field("Sync handle: %d", le16_to_cpu(evt->handle));
if (evt->sid > 0x0f)
print_field("Advertising SID: Reserved (0x%2.2x)", evt->sid);
else
@@ -13924,7 +13924,7 @@ static void le_pa_report_evt(struct timeval *tv, uint16_t index,
const char *color_on;
const char *str;
- print_field("Sync handle: %d", evt->handle);
+ print_field("Sync handle: %d", le16_to_cpu(evt->handle));
if (evt->tx_power == 127)
print_field("TX power: not available (0x7f)");
else
--
2.47.3
next prev parent reply other threads:[~2026-11-20 6:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 6:38 [PATCH BlueZ v4 00/10] monitor: Decode Periodic Advertising with Responses Roland Schober
2026-11-20 6:38 ` [PATCH BlueZ v4 01/10] monitor: Fix handle decoding of status_handle_rsp Roland Schober
2026-11-20 6:38 ` [PATCH BlueZ v4 02/10] monitor: Fix data length of LE PA Report decoding Roland Schober
2026-11-20 6:38 ` [PATCH BlueZ v4 03/10] monitor: Fix PHY decoding of LE Ext Create Connection Roland Schober
2026-11-20 6:38 ` [PATCH BlueZ v4 04/10] monitor: Fix advertising handle of LE PA commands Roland Schober
2026-11-20 6:38 ` [PATCH BlueZ v4 05/10] monitor: Fix TX power and CTE Type of LE PA Report Roland Schober
2026-11-20 6:38 ` [PATCH BlueZ v4 06/10] monitor: Fix LE PAST Received decoding Roland Schober
2026-11-20 6:38 ` Roland Schober [this message]
2026-11-20 6:38 ` [PATCH BlueZ v4 08/10] monitor: Split LE PA Report decoding into helpers Roland Schober
2026-11-20 6:38 ` [PATCH BlueZ v4 09/10] monitor: Add PAwR HCI commands decoding Roland Schober
2026-11-20 6:38 ` [PATCH BlueZ v4 10/10] monitor: Add PAwR HCI events decoding Roland Schober
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=20261120063856.16585-8-rolandschober1968@gmail.com \
--to=rolandschober1968@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox