All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roland Schober <rolandschober1968@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Roland Schober <rolandschober1968@gmail.com>
Subject: [PATCH BlueZ v4 06/10] monitor: Fix LE PAST Received decoding
Date: Fri, 20 Nov 2026 07:38:52 +0100	[thread overview]
Message-ID: <20261120063856.16585-7-rolandschober1968@gmail.com> (raw)
In-Reply-To: <20261120063856.16585-1-rolandschober1968@gmail.com>

The LE Periodic Advertising Sync Transfer Received decoder prints the
connection handle twice, doubles the colon of three labels, prints the
interval without a unit and decodes the 1 octet Advertiser_Clock_Accuracy
as a BR/EDR clock accuracy in units of 0.3125 ms:

        Handle: 3585
        Connection handle: 3585
        ...
        Address type:: Random (0x01)
        Address:: C0:11:22:33:44:55 (Static)
        PHY:: LE 2M (0x02)
        Periodic advertising Interval: 1000.000
        Accuracy: 1.5625 msec (0x0005)

Decode it the way LE Periodic Advertising Sync Established is decoded:

        Handle: 3585 (LE-ACL) Address: C0:11:22:33:44:55 (Static)
        ...
        Address type: Random (0x01)
        Address: C0:11:22:33:44:55 (Static)
        PHY: LE 2M (0x02)
        Periodic advertising interval: 1000.00 msec (0x0320)
        Advertiser clock accuracy: 0x05

Fixes: 228c945a93a4 ("monitor: Decode LE Periodic Advertising Sync Transfer Received Event")
Assisted-by: Claude:claude-opus-5-5
---
 monitor/packet.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/monitor/packet.c b/monitor/packet.c
index 034a1e82a..ce05928c1 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -14059,17 +14059,15 @@ static void le_past_received_evt(struct timeval *tv, uint16_t index,
 	const struct bt_hci_evt_le_past_recv *evt = data;
 
 	print_status(evt->status);
-	print_field("Handle: %d", evt->handle);
-	print_field("Connection handle: %d", evt->handle);
-	print_field("Service data: 0x%4.4x", evt->service_data);
-	print_field("Sync handle: %d", evt->sync_handle);
+	print_handle(evt->handle);
+	print_field("Service data: 0x%4.4x", le16_to_cpu(evt->service_data));
+	print_field("Sync handle: %d", le16_to_cpu(evt->sync_handle));
 	print_field("SID: 0x%2.2x", evt->sid);
-	print_peer_addr_type("Address type:", evt->addr_type);
-	print_addr("Address:", evt->addr, evt->addr_type);
-	print_le_phy("PHY:", evt->phy);
-	print_field("Periodic advertising Interval: %.3f",
-							1.25 * evt->interval);
-	print_clock_accuracy(evt->clock_accuracy);
+	print_peer_addr_type("Address type", evt->addr_type);
+	print_addr("Address", evt->addr, evt->addr_type);
+	print_le_phy("PHY", evt->phy);
+	print_slot_125("Periodic advertising interval", evt->interval);
+	print_field("Advertiser clock accuracy: 0x%2.2x", evt->clock_accuracy);
 }
 
 static void le_cis_established_evt(struct timeval *tv, uint16_t index,
-- 
2.47.3


  parent reply	other threads:[~2026-11-20  6:39 UTC|newest]

Thread overview: 13+ 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 14:51   ` monitor: Decode Periodic Advertising with Responses bluez.test.bot
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 ` Roland Schober [this message]
2026-11-20  6:38 ` [PATCH BlueZ v4 07/10] monitor: Fix byte order of LE PA Sync Handle and Properties Roland Schober
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
2026-11-20 15:34 ` [PATCH BlueZ v4 00/10] monitor: Decode Periodic Advertising with Responses Luiz Augusto von Dentz

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-7-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.