From 99fda38355e94f7be50c3a2652b5e4c9bd8c9755 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 8 Oct 2015 00:01:11 +0200 Subject: [PATCH] monitor: Add support for decoding LMP slot offset transaction --- monitor/bt.h | 6 ++++++ monitor/lmp.c | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/monitor/bt.h b/monitor/bt.h index d06101f0a..63a0443ed 100644 --- a/monitor/bt.h +++ b/monitor/bt.h @@ -219,6 +219,12 @@ struct bt_lmp_timing_accuracy_res { #define BT_LMP_HOST_CONNECTION_REQ 51 +#define BT_LMP_SLOT_OFFSET 52 +struct bt_lmp_slot_offset { + uint16_t offset; + uint8_t bdaddr[6]; +} __attribute__ ((packed)); + #define BT_LMP_PAGE_SCAN_MODE_REQ 54 struct bt_lmp_page_scan_mode_req { uint8_t scheme; diff --git a/monitor/lmp.c b/monitor/lmp.c index bbb7a067b..6e8070b83 100644 --- a/monitor/lmp.c +++ b/monitor/lmp.c @@ -303,6 +303,14 @@ static void host_connection_req(const void *data, uint8_t size) { } +static void slot_offset(const void *data, uint8_t size) +{ + const struct bt_lmp_slot_offset *pdu = data; + + print_field("Offset: %u usec", le16_to_cpu(pdu->offset)); + packet_print_addr("Address", pdu->bdaddr, false); +} + static void page_scan_mode_req(const void *data, uint8_t size) { const struct bt_lmp_page_scan_mode_req *pdu = data; @@ -758,7 +766,7 @@ static const struct lmp_data lmp_table[] = { { 49, "LMP_setup_complete", setup_complete, 0, true }, { 50, "LMP_use_semi_permanent_key", use_semi_permanent_key, 0, true }, { 51, "LMP_host_connection_req", host_connection_req, 0, true }, - { 52, "LMP_slot_offset" }, + { 52, "LMP_slot_offset", slot_offset, 8, true }, { 53, "LMP_page_mode_req" }, { 54, "LMP_page_scan_mode_req", page_scan_mode_req, 2, true }, { 55, "LMP_supervision_timeout" }, -- 2.47.3