monitor: Decode LE Periodic Advertising Sync Established Event
PATCH 1/3 monitor: Decode LE Periodic Advertising Sync Established Event
Quoted 1 line
HCI Event: LE Meta Event (
0x3e) plen 16 #976 [hci1] 607.133703
LE Periodic Advertising Sync Established (0x0e)
Status: Success (0x00)
Sync handle: 0
Advertising SID: 0x06
Advertiser address type: Random (0x01)
Advertiser address: FF:00:00:00:00:AA (Static)
Advertiser PHY: LE 1M (0x01)
Periodic advertising invteral: 50.00 msec (0x0028)
Advertiser clock accuracy: 0x04
---
monitor/bt.h | 12 ++++++++++++
monitor/packet.c | 21 ++++++++++++++++++++-
2 files changed, 32 insertions(+), 1 deletion(-)monitor/bt.h +12 -0
@@ -3091,6 +3091,18 @@ struct bt_hci_le_ext_adv_report {uint8_t data[0 ]; } __attribute__ ((packed)); +#define BT_HCI_EVT_LE_PER_SYNC_ESTABLISHED 0x0e +struct bt_hci_evt_le_per_sync_established { +uint8_t status; +uint16_t handle; +uint8_t sid; +uint8_t addr_type; +uint8_t addr[6 ]; +uint8_t phy; +uint16_t interval; +uint8_t clock_accuracy; +} __attribute__ ((packed)); +#define BT_HCI_EVT_LE_ADV_SET_TERM 0x12struct bt_hci_evt_le_adv_set_term {uint8_t status;
monitor/packet.c +20 -1
@@ -9613,6 +9613,24 @@ static void le_ext_adv_report_evt(const void *data, uint8_t size) } } +static void le_per_adv_sync (const void *data,uint8_t size) +{ +const struct bt_hci_evt_le_per_sync_established *evt = data; + +print_status (evt->status); +print_field ("Sync handle: %d" , evt->handle); +if (evt->sid >0x0f ) +print_field ("Advertising SID: Reserved (0x%2.2x)" , evt->sid); +else +print_field ("Advertising SID: 0x%2.2x" , evt->sid); + +print_peer_addr_type ("Advertiser address type" , evt->addr_type); +print_addr ("Advertiser address" , evt->addr, evt->addr_type); +print_le_phy ("Advertiser PHY" , evt->phy); +print_slot_125 ("Periodic advertising invteral" , evt->interval); +print_field ("Advertiser clock accuracy: 0x%2.2x" , evt->clock_accuracy); +} +static void le_adv_set_term_evt (const void *data,uint8_t size) {const struct bt_hci_evt_le_adv_set_term *evt = data;
@@ -9726,7 +9744,8 @@ static const struct subevent_data le_meta_event_table[] = { le_phy_update_complete_evt, 5, true}, {0x0d ,"LE Extended Advertising Report" , le_ext_adv_report_evt, 1, false}, - { 0x0e, "LE Periodic Advertising Sync Established" }, + { 0x0e, "LE Periodic Advertising Sync Established", + le_per_adv_sync, 15, true }, { 0x0f, "LE Periodic Advertising Report" }, { 0x10, "LE Periodic Advertising Sync Lost" }, { 0x11, "LE Scan Timeout" },
Signature · 1 line
2.20.1
PATCH 2/3 monitor: Decode LE Periodic Advertising Report Event
Quoted 1 line
HCI Event: LE Meta Event (
0x3e) plen 18 #19 [hci2] 16.562639
LE Periodic Advertising Report (0x0f)
Sync handle: 0
TX power: -4 dbm (0xfc)
RSSI: -55 dBm (0xc9)
Unused: (0xff)
Data status: Complete
Data length: 0x0a
b0 b1 b2 b3 b4 b5 b6 b7 b8 b9
---
monitor/bt.h | 11 +++++++++++
monitor/packet.c | 46 +++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 56 insertions(+), 1 deletion(-)monitor/bt.h +11 -0
@@ -3103,6 +3103,17 @@ struct bt_hci_evt_le_per_sync_established {uint8_t clock_accuracy; } __attribute__ ((packed)); +#define BT_HCI_EVT_LE_PER_ADV_REPORT 0x0f +struct bt_hci_le_per_adv_report { +uint16_t handle; +uint8_t tx_power; +int8_t rssi; +uint8_t unused; +uint8_t data_status; +uint8_t data_len; +uint8_t data[0 ]; +} __attribute__ ((packed)); +#define BT_HCI_EVT_LE_ADV_SET_TERM 0x12struct bt_hci_evt_le_adv_set_term {uint8_t status;
monitor/packet.c +45 -1
58 lines not on this page · raw message
Signature · 1 line
2.20.1
PATCH 3/3 monitor: Decode LE Periodic Advertising Sync Lost Event
In reply to Szymon JancQuoted 1 line
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(-)
monitor/bt.h +5 -0
@@ -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 0x12struct bt_hci_evt_le_adv_set_term {uint8_t status;
monitor/packet.c +9 -1
@@ -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},
Signature · 1 line
2.20.1
Hi Szymon,
Quoted 79 lines · Szymon Janc
Quoted 2 lines
HCI Event: LE Meta Event (
0x3e) plen 16 #976 [hci1] 607.133703LE Periodic Advertising Sync Established (0x0e) Status: Success (0x00) Sync handle: 0 Advertising SID: 0x06 Advertiser address type: Random (0x01) Advertiser address: FF:00:00:00:00:AA (Static) Advertiser PHY: LE 1M (0x01) Periodic advertising invteral: 50.00 msec (0x0028) Advertiser clock accuracy: 0x04 --- monitor/bt.h | 12 ++++++++++++ monitor/packet.c | 21 ++++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-)monitor/bt.h +12
-0@@ -3091,6 +3091,18 @@ struct bt_hci_le_ext_adv_report {uint8_t data[0 ]; } __attribute__ ((packed)); +#define BT_HCI_EVT_LE_PER_SYNC_ESTABLISHED 0x0e +struct bt_hci_evt_le_per_sync_established { +uint8_t status; +uint16_t handle; +uint8_t sid; +uint8_t addr_type; +uint8_t addr[6 ]; +uint8_t phy; +uint16_t interval; +uint8_t clock_accuracy; +} __attribute__ ((packed)); +#define BT_HCI_EVT_LE_ADV_SET_TERM 0x12struct bt_hci_evt_le_adv_set_term {uint8_t status;monitor/packet.c +20
-2@@ -9613,6 +9613,24 @@ static void le_ext_adv_report_evt(const void *data, uint8_t size) } } +static void le_per_adv_sync (const void *data,uint8_t size) +{ +const struct bt_hci_evt_le_per_sync_established *evt = data; + +print_status (evt->status); +print_field ("Sync handle: %d" , evt->handle); +if (evt->sid >0x0f ) +print_field ("Advertising SID: Reserved (0x%2.2x)" , evt->sid); +else +print_field ("Advertising SID: 0x%2.2x" , evt->sid); + +print_peer_addr_type ("Advertiser address type" , evt->addr_type); +print_addr ("Advertiser address" , evt->addr, evt->addr_type); +print_le_phy ("Advertiser PHY" , evt->phy); +print_slot_125 ("Periodic advertising invteral" , evt->interval); +print_field ("Advertiser clock accuracy: 0x%2.2x" , evt->clock_accuracy); +} +static void le_adv_set_term_evt (const void *data,uint8_t size) {const struct bt_hci_evt_le_adv_set_term *evt = data;@@ -9726,7 +9744,8 @@ static const struct subevent_data le_meta_event_table[] = { le_phy_update_complete_evt, 5, true}, {0x0d ,"LE Extended Advertising Report" , le_ext_adv_report_evt, 1, false}, - { 0x0e, "LE Periodic Advertising Sync Established" }, + { 0x0e, "LE Periodic Advertising Sync Established", + le_per_adv_sync, 15, true }, { 0x0f, "LE Periodic Advertising Report" }, { 0x10, "LE Periodic Advertising Sync Lost" }, { 0x11, "LE Scan Timeout" }, --
Quoted 1 line
2.20.1
Applied, thanks.
Signature · 1 line
Luiz Augusto von Dentz