From e01b3ba863ee4b6a3a290366ff4c916a378eb661 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 9 Oct 2015 15:34:32 +0200 Subject: [PATCH] monitor: Add support for decoding LMP clock offset response --- 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 fd7d46c07..b869b02d9 100644 --- a/monitor/bt.h +++ b/monitor/bt.h @@ -126,6 +126,11 @@ struct bt_lmp_not_accepted { #define BT_LMP_CLKOFFSET_REQ 5 +#define BT_LMP_CLKOFFSET_RSP 6 +struct bt_lmp_clkoffset_rsp { + uint16_t offset; +} __attribute__ ((packed)); + #define BT_LMP_DETACH 7 struct bt_lmp_detach { uint8_t error; diff --git a/monitor/lmp.c b/monitor/lmp.c index 93ff08af6..d246776a1 100644 --- a/monitor/lmp.c +++ b/monitor/lmp.c @@ -94,6 +94,13 @@ static void clkoffset_req(const void *data, uint8_t size) { } +static void clkoffset_rsp(const void *data, uint8_t size) +{ + const struct bt_lmp_clkoffset_rsp *pdu = data; + + print_field("Clock offset: 0x%4.4x", le16_to_cpu(pdu->offset)); +} + static void detach(const void *data, uint8_t size) { const struct bt_lmp_detach *pdu = data; @@ -727,7 +734,7 @@ static const struct lmp_data lmp_table[] = { { 3, "LMP_accepted", accepted, 1, true }, { 4, "LMP_not_accepted", not_accepted, 2, true }, { 5, "LMP_clkoffset_req", clkoffset_req, 0, true }, - { 6, "LMP_clkoffset_res" }, + { 6, "LMP_clkoffset_res", clkoffset_rsp, 2, true }, { 7, "LMP_detach", detach, 1, true }, { 8, "LMP_in_rand" }, { 9, "LMP_comb_key" }, -- 2.47.3