monitor: Add decoding support for LL_PHY_UPDATE_IND
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tue, 26 Feb 2019 13:17:05 +0000 (15:17 +0200)
committerhimanshu <h.himanshu@samsung.com>
Tue, 11 Feb 2020 08:57:47 +0000 (14:27 +0530)
This prints makes the fields to be printed instead of just decoding
the PDU name.

Change-Id: Ie073880a8ed77c59d84c2e585486b2222a16926a
Signed-off-by: himanshu <h.himanshu@samsung.com>
monitor/bt.h
monitor/ll.c

index aa4057a..46d9b28 100755 (executable)
@@ -136,6 +136,13 @@ struct bt_ll_phy {
 
 #define BT_LL_PHY_RSP          0x17
 
+#define BT_LL_PHY_UPDATE_IND   0x18
+struct bt_ll_phy_update_ind {
+       uint8_t  m_phy;
+       uint8_t  s_phy;
+       uint16_t instant;
+} __attribute__ ((packed));
+
 #define LMP_ESC4(x) ((127 << 8) | (x))
 
 #define BT_LMP_NAME_REQ                        1
index 20511e6..0ba6c94 100755 (executable)
@@ -512,6 +512,28 @@ static void phy_req_rsp(const void *data, uint8_t size)
                                                        " (0x%2.2x)", mask);
 }
 
+static void phy_update_ind(const void *data, uint8_t size)
+{
+       const struct bt_ll_phy_update_ind *pdu = data;
+       uint8_t mask;
+
+       print_field("M_TO_S_PHY: 0x%2.2x", pdu->m_phy);
+
+       mask = print_bitfield(2, pdu->m_phy, le_phys);
+       if (mask)
+               print_text(COLOR_UNKNOWN_OPTIONS_BIT, "  Reserved"
+                                                       " (0x%2.2x)", mask);
+
+       print_field("S_TO_M_PHY: 0x%2.2x", pdu->s_phy);
+
+       mask = print_bitfield(2, pdu->s_phy, le_phys);
+       if (mask)
+               print_text(COLOR_UNKNOWN_OPTIONS_BIT, "  Reserved"
+                                                       " (0x%2.2x)", mask);
+
+       print_field("Instant: 0x%4.4x", pdu->instant);
+}
+
 struct llcp_data {
        uint8_t opcode;
        const char *str;
@@ -545,7 +567,7 @@ static const struct llcp_data llcp_table[] = {
        { 0x15, "LL_LENGTH_RSP",            length_req_rsp,     8, true },
        { 0x16, "LL_PHY_REQ",               phy_req_rsp,        2, true },
        { 0x17, "LL_PHY_RSP",               phy_req_rsp,        2, true },
-       { 0x18, "LL_PHY_UPDATE_IND",        NULL,               4, true },
+       { 0x18, "LL_PHY_UPDATE_IND",        phy_update_ind,     4, true },
        { 0x19, "LL_MIN_USED_CHANNELS_IND", NULL,               2, true },
        { }
 };