From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ v2 11/12] monitor: Prefix data packets with proper type
Date: Fri, 20 Feb 2026 12:31:15 -0500 [thread overview]
Message-ID: <20260220173120.3418666-11-luiz.dentz@gmail.com> (raw)
In-Reply-To: <20260220173120.3418666-1-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This attemps to prefix data packets using conn_type_str so it
properly differentiate BR and LE bearers and CIS from BIS and also
eliminate "Data TX/RX" labels as they are implicit from the direction
marker:
< LE-CIS: Handle 2304 [8/8] SN 15 ...
> LE-ACL: Handle 2048 ...
---
monitor/packet.c | 27 +++++++++++++++++++++------
1 file changed, 21 insertions(+), 6 deletions(-)
diff --git a/monitor/packet.c b/monitor/packet.c
index a4930c855144..fbe773ffbdfe 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -14155,6 +14155,7 @@ void packet_hci_acldata(struct timeval *tv, struct ucred *cred, uint16_t index,
uint16_t handle = le16_to_cpu(hdr->handle);
uint16_t dlen = le16_to_cpu(hdr->dlen);
uint8_t flags = acl_flags(handle);
+ char label[8];
char handle_str[58], extra_str[32];
struct packet_conn_data *conn;
struct index_buf_pool *pool = &index_list[index].acl;
@@ -14194,9 +14195,13 @@ void packet_hci_acldata(struct timeval *tv, struct ucred *cred, uint16_t index,
sprintf(extra_str, "flags 0x%2.2x dlen %d", flags, dlen);
+ if (conn)
+ sprintf(label, "%s", conn_type_str(conn->type));
+ else
+ sprintf(label, "ACL");
+
print_packet(tv, cred, in ? '>' : '<', index, NULL, COLOR_HCI_ACLDATA,
- in ? "ACL Data RX" : "ACL Data TX",
- handle_str, extra_str);
+ label, handle_str, extra_str);
if (!in)
packet_enqueue_tx(tv, acl_handle(handle),
@@ -14221,6 +14226,7 @@ void packet_hci_scodata(struct timeval *tv, struct ucred *cred, uint16_t index,
const hci_sco_hdr *hdr = data;
uint16_t handle = le16_to_cpu(hdr->handle);
uint8_t flags = acl_flags(handle);
+ char label[8];
char handle_str[42], extra_str[32];
struct packet_conn_data *conn;
@@ -14256,9 +14262,13 @@ void packet_hci_scodata(struct timeval *tv, struct ucred *cred, uint16_t index,
sprintf(extra_str, "flags 0x%2.2x dlen %d", flags, hdr->dlen);
+ if (conn)
+ sprintf(label, "%s", conn_type_str(conn->type));
+ else
+ sprintf(label, "SCO");
+
print_packet(tv, cred, in ? '>' : '<', index, NULL, COLOR_HCI_SCODATA,
- in ? "SCO Data RX" : "SCO Data TX",
- handle_str, extra_str);
+ label, handle_str, extra_str);
if (!in)
packet_enqueue_tx(tv, acl_handle(handle),
@@ -14282,6 +14292,7 @@ void packet_hci_isodata(struct timeval *tv, struct ucred *cred, uint16_t index,
const struct bt_hci_iso_data_start *start;
uint16_t handle = le16_to_cpu(hdr->handle);
uint8_t flags = acl_flags(handle);
+ char label[8];
char handle_str[56], extra_str[50], ts_str[16] = { 0 };
struct index_buf_pool *pool = &index_list[index].iso;
struct packet_conn_data *conn;
@@ -14328,9 +14339,13 @@ void packet_hci_isodata(struct timeval *tv, struct ucred *cred, uint16_t index,
sprintf(extra_str, "flags 0x%2.2x dlen %u slen %u%s", flags, hdr->dlen,
start->slen, ts_str);
+ if (conn)
+ sprintf(label, "%s", conn_type_str(conn->type));
+ else
+ sprintf(label, "ISO");
+
print_packet(tv, cred, in ? '>' : '<', index, NULL, COLOR_HCI_ISODATA,
- in ? "ISO Data RX" : "ISO Data TX",
- handle_str, extra_str);
+ label, handle_str, extra_str);
if (!in)
packet_enqueue_tx(tv, acl_handle(handle),
--
2.52.0
next prev parent reply other threads:[~2026-02-20 17:31 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-20 17:31 [PATCH BlueZ v2 01/12] doc/btmon: Add missing documentation Luiz Augusto von Dentz
2026-02-20 17:31 ` [PATCH BlueZ v2 02/12] doc/btmon: Add dedicate sections for timestamp and frame number Luiz Augusto von Dentz
2026-02-20 17:31 ` [PATCH BlueZ v2 03/12] doc/btmon: Add connection tracking section Luiz Augusto von Dentz
2026-02-20 17:31 ` [PATCH BlueZ v2 04/12] doc/btmon: Add a dedicated section for analyze mode Luiz Augusto von Dentz
2026-02-20 17:31 ` [PATCH BlueZ v2 05/12] doc/btmon: Add a section for automated trace analysis Luiz Augusto von Dentz
2026-02-20 17:31 ` [PATCH BlueZ v2 06/12] doc: add btsnoop protocol manpage Luiz Augusto von Dentz
2026-02-20 17:31 ` [PATCH BlueZ v2 07/12] doc/btmon: Add reference to btsnoop documention Luiz Augusto von Dentz
2026-02-20 17:31 ` [PATCH BlueZ v2 08/12] monitor: Annotate ACL/SCO/ISO data with device address Luiz Augusto von Dentz
2026-02-20 17:31 ` [PATCH BlueZ v2 09/12] monitor: Print connection type in Disconnect Complete Luiz Augusto von Dentz
2026-02-20 17:31 ` [PATCH BlueZ v2 10/12] monitor: Add connection lifecycle to analyze summary Luiz Augusto von Dentz
2026-02-20 17:31 ` Luiz Augusto von Dentz [this message]
2026-02-20 17:31 ` [PATCH BlueZ v2 12/12] doc/btmon: Update documentation to reflect lastest changes Luiz Augusto von Dentz
2026-02-20 18:25 ` [BlueZ,v2,01/12] doc/btmon: Add missing documentation bluez.test.bot
2026-02-20 20:20 ` [PATCH BlueZ v2 01/12] " patchwork-bot+bluetooth
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=20260220173120.3418666-11-luiz.dentz@gmail.com \
--to=luiz.dentz@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