From b88ca361f23be5e2ba0853bc79a612785274cd12 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Tue, 26 Feb 2019 19:01:14 +0200 Subject: [PATCH] monitor: Decode LL_CTE_* This introduces the command passing for LL_CTE_* PDUs added in 5.1. Change-Id: Ife9c82a0497872b29672ecbb4b6c2d5622a32eee Signed-off-by: himanshu --- monitor/bt.h | 7 +++++++ monitor/ll.c | 22 ++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/monitor/bt.h b/monitor/bt.h index 80f514f..f3995b4 100755 --- a/monitor/bt.h +++ b/monitor/bt.h @@ -149,6 +149,13 @@ struct bt_ll_min_used_channels { uint8_t min_channels; } __attribute__ ((packed)); +#define BT_LL_CTE_REQ 0x1a +struct bt_ll_cte_req { + uint8_t cte; +} __attribute__ ((packed)); + +#define BT_LL_CTE_RSP 0x1b + #define LMP_ESC4(x) ((127 << 8) | (x)) #define BT_LMP_NAME_REQ 1 diff --git a/monitor/ll.c b/monitor/ll.c index ec6e36a..fdfea42 100755 --- a/monitor/ll.c +++ b/monitor/ll.c @@ -549,6 +549,26 @@ static void min_used_channels(const void *data, uint8_t size) print_field("MinUsedChannels: 0x%2.2x", pdu->min_channels); } +static void cte_req(const void *data, uint8_t size) +{ + const struct bt_ll_cte_req *pdu = data; + + print_field("MinCTELenReq: 0x%2.2x", pdu->cte & 0xf8); + print_field("CTETypeReq: 0x%2.2x", pdu->cte & 0x03); + + switch (pdu->cte & 0x03) { + case 0x00: + print_field(" AoA Constant Tone Extension"); + break; + case 0x01: + print_field(" AoD Constant Tone Extension with 1 μs slots"); + break; + case 0x02: + print_field(" AoD Constant Tone Extension with 2 μs slots"); + break; + } +} + struct llcp_data { uint8_t opcode; const char *str; @@ -584,6 +604,8 @@ static const struct llcp_data llcp_table[] = { { 0x17, "LL_PHY_RSP", phy_req_rsp, 2, true }, { 0x18, "LL_PHY_UPDATE_IND", phy_update_ind, 4, true }, { 0x19, "LL_MIN_USED_CHANNELS_IND", min_used_channels, 2, true }, + { 0x1a, "LL_CTE_REQ", cte_req, 1, true }, + { 0x1b, "LL_CTE_RSP", null_pdu, 0, true }, { } }; -- 2.7.4