linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Szymon Janc <szymon.janc@codecoup.pl>
To: linux-bluetooth@vger.kernel.org
Cc: Szymon Janc <szymon.janc@codecoup.pl>
Subject: [PATCH 3/3] monitor: Decode LE Periodic Advertising Sync Lost Event
Date: Wed, 22 May 2019 11:24:03 +0200	[thread overview]
Message-ID: <20190522092403.20927-3-szymon.janc@codecoup.pl> (raw)
In-Reply-To: <20190522092403.20927-1-szymon.janc@codecoup.pl>

> HCI Event: LE Meta Event (0x3e) plen 3
      LE Periodic Advertising Sync Lost (0x10)
        Sync handle: 0
---
 monitor/bt.h     |  5 +++++
 monitor/packet.c | 10 +++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/monitor/bt.h b/monitor/bt.h
index 8622ea4d4..8edc895e8 100644
--- a/monitor/bt.h
+++ b/monitor/bt.h
@@ -3114,6 +3114,11 @@ struct bt_hci_le_per_adv_report {
 	uint8_t  data[0];
 } __attribute__ ((packed));
 
+#define BT_HCI_EVT_LE_PER_SYNC_LOST	0x10
+struct bt_hci_evt_le_per_sync_lost {
+	uint16_t handle;
+} __attribute__ ((packed));
+
 #define BT_HCI_EVT_LE_ADV_SET_TERM		0x12
 struct bt_hci_evt_le_adv_set_term {
 	uint8_t  status;
diff --git a/monitor/packet.c b/monitor/packet.c
index 8b2671edb..ab8bbdee5 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -9674,6 +9674,13 @@ static void le_per_adv_report_evt(const void *data, uint8_t size)
 	packet_hexdump(evt->data, evt->data_len);
 }
 
+static void le_per_adv_sync_lost(const void *data, uint8_t size)
+{
+	const struct bt_hci_evt_le_per_sync_lost *evt = data;
+
+	print_field("Sync handle: %d", evt->handle);
+}
+
 static void le_adv_set_term_evt(const void *data, uint8_t size)
 {
 	const struct bt_hci_evt_le_adv_set_term *evt = data;
@@ -9791,7 +9798,8 @@ static const struct subevent_data le_meta_event_table[] = {
 				le_per_adv_sync, 15, true },
 	{ 0x0f, "LE Periodic Advertising Report",
 				le_per_adv_report_evt, 7, false},
-	{ 0x10, "LE Periodic Advertising Sync Lost" },
+	{ 0x10, "LE Periodic Advertising Sync Lost",
+				le_per_adv_sync_lost, 2, true},
 	{ 0x11, "LE Scan Timeout" },
 	{ 0x12, "LE Advertising Set Terminated",
 				le_adv_set_term_evt, 5, true},
-- 
2.20.1


  parent reply	other threads:[~2019-05-22  9:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-22  9:24 [PATCH 1/3] monitor: Decode LE Periodic Advertising Sync Established Event Szymon Janc
2019-05-22  9:24 ` [PATCH 2/3] monitor: Decode LE Periodic Advertising Report Event Szymon Janc
2019-05-22  9:24 ` Szymon Janc [this message]
2019-05-24  8:50 ` [PATCH 1/3] monitor: Decode LE Periodic Advertising Sync Established Event 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=20190522092403.20927-3-szymon.janc@codecoup.pl \
    --to=szymon.janc@codecoup.pl \
    --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;
as well as URLs for NNTP newsgroup(s).