[PATCH v3 6/6] monitor: Add basic decoding for Mesh Data

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

 



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

This adds basic decoding for Mesh Data packets such as:

> HCI Event: LE Meta Event (0x3e) plen 43
      LE Advertising Report (0x02)
        Num reports: 1
        Event type: Non connectable undirected - ADV_NONCONN_IND (0x03)
        Address type: Random (0x01)
        Address: 29:3C:CE:85:C7:3D (Non-Resolvable)
        Data length: 31
        Mesh Data: 37cb3a2bdfca0783b10833cfbdc9e691b0d58b2dada00269181477c901
          IV: 1
          NID: 0x1b
        RSSI: -28 dBm (0xe4)
---
 monitor/packet.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/monitor/packet.c b/monitor/packet.c
index 3906eee..9bac689 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -3685,6 +3685,18 @@ static void print_mesh_prov(const uint8_t *data, uint8_t len)
 	}
 }
 
+static void print_mesh_data(const uint8_t *data, uint8_t len)
+{
+	print_hex_field("Mesh Data", data, len);
+
+	if (len < 1)
+		return;
+
+	print_field("  IV: %u", data[0] & 0x01);
+	print_field("  NID: 0x%2.2x", data[0] & 0xfe);
+	packet_hexdump(data + 1, len - 1);
+}
+
 static void print_eir(const uint8_t *eir, uint8_t eir_len, bool le)
 {
 	uint16_t len = 0;
@@ -3910,7 +3922,7 @@ static void print_eir(const uint8_t *eir, uint8_t eir_len, bool le)
 			break;
 
 		case BT_EIR_MESH_DATA:
-			print_hex_field("Mesh Data", data, data_len);
+			print_mesh_data(data, data_len);
 			break;
 
 		case BT_EIR_MESH_PROV:
-- 
2.9.4

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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