[PATCH BlueZ 1/7] monitor: Add decoding support for LL_LENGTH_*

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

This prints makes the fields to be printed instead of just decoding
the PDU name.
---
 monitor/bt.h |  6 ++++++
 monitor/ll.c | 14 ++++++++++++--
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/monitor/bt.h b/monitor/bt.h
index 1fbb40efc..59d5c20af 100644
--- a/monitor/bt.h
+++ b/monitor/bt.h
@@ -119,6 +119,12 @@ struct bt_ll_reject_ind_ext {
 #define BT_LL_PING_RSP		0x13
 
 #define BT_LL_LENGTH_REQ	0x14
+struct bt_ll_length {
+	uint16_t rx_len;
+	uint16_t rx_time;
+	uint16_t tx_len;
+	uint16_t tx_time;
+} __attribute__ ((packed));
 
 #define BT_LL_LENGTH_RSP	0x15
 
diff --git a/monitor/ll.c b/monitor/ll.c
index 3ddbf7a07..c70c1166f 100644
--- a/monitor/ll.c
+++ b/monitor/ll.c
@@ -476,6 +476,16 @@ static void reject_ind_ext(const void *data, uint8_t size)
 	packet_print_error("Error code", pdu->error);
 }
 
+static void length_req_rsp(const void *data, uint8_t size)
+{
+	const struct bt_ll_length *pdu = data;
+
+	print_field("MaxRxOctets: %u", pdu->rx_len);
+	print_field("MaxRxTime: %u", pdu->rx_time);
+	print_field("MaxTxOctets: %u", pdu->tx_len);
+	print_field("MaxtxTime: %u", pdu->tx_time);
+}
+
 struct llcp_data {
 	uint8_t opcode;
 	const char *str;
@@ -505,8 +515,8 @@ static const struct llcp_data llcp_table[] = {
 	{ 0x11, "LL_REJECT_IND_EXT",        reject_ind_ext,     2, true },
 	{ 0x12, "LL_PING_REQ",              null_pdu,           0, true },
 	{ 0x13, "LL_PING_RSP",              null_pdu,           0, true },
-	{ 0x14, "LL_LENGTH_REQ",            NULL,               8, true },
-	{ 0x15, "LL_LENGTH_RSP",            NULL,               8, true },
+	{ 0x14, "LL_LENGTH_REQ",            length_req_rsp,     8, true },
+	{ 0x15, "LL_LENGTH_RSP",            length_req_rsp,     8, true },
 	{ 0x16, "LL_PHY_REQ",               NULL,               2, true },
 	{ 0x17, "LL_PHY_RSP",               NULL,               2, true },
 	{ 0x18, "LL_PHY_UPDATE_IND",        NULL,               4, true },
-- 
2.17.2




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux