From 57133737a1238d26e6fce482e73800f1da4139a2 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 8 Oct 2015 00:08:10 +0200 Subject: [PATCH] monitor: Add support for decoding LMP switch request --- monitor/bt.h | 5 +++++ monitor/lmp.c | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/monitor/bt.h b/monitor/bt.h index 63a0443ed..fd7d46c07 100644 --- a/monitor/bt.h +++ b/monitor/bt.h @@ -158,6 +158,11 @@ struct bt_lmp_start_encryption_req { #define BT_LMP_STOP_ENCRYPTION_REQ 18 +#define BT_LMP_SWITCH_REQ 19 +struct bt_lmp_switch_req { + uint32_t instant; +} __attribute__ ((packed)); + #define BT_LMP_UNSNIFF_REQ 24 #define BT_LMP_MAX_POWER 33 diff --git a/monitor/lmp.c b/monitor/lmp.c index 6e8070b83..93ff08af6 100644 --- a/monitor/lmp.c +++ b/monitor/lmp.c @@ -156,6 +156,13 @@ static void stop_encryption_req(const void *data, uint8_t size) { } +static void switch_req(const void *data, uint8_t size) +{ + const struct bt_lmp_switch_req *pdu = data; + + print_field("Instant: 0x%8.8x", le32_to_cpu(pdu->instant)); +} + static void unsniff_req(const void *data, uint8_t size) { } @@ -733,7 +740,7 @@ static const struct lmp_data lmp_table[] = { { 16, "LMP_encryption_key_size_req", encryption_key_size_req, 1, true }, { 17, "LMP_start_encryption_req", start_encryption_req, 16, true }, { 18, "LMP_stop_encryption_req", stop_encryption_req, 0, true }, - { 19, "LMP_switch_req" }, + { 19, "LMP_switch_req", switch_req, 4, true }, { 20, "LMP_hold" }, { 21, "LMP_hold_req" }, { 22, "LMP_sniff" }, -- 2.47.3