Diff between 851b3fd5c759ea84fbc83c13c0365e8c2f446bee and 34af2e79ad21dce9ce2e5758f9001ffe6fa4e24d

Changed Files

File Additions Deletions Status
tools/parser/avctp.c +27 -2 modified

Full Patch

diff --git a/tools/parser/avctp.c b/tools/parser/avctp.c
index 4a8876c..aa2def1 100644
--- a/tools/parser/avctp.c
+++ b/tools/parser/avctp.c
@@ -36,10 +36,35 @@
 
 #include "parser.h"
 
+static char *pt2str(uint8_t hdr)
+{
+	switch (hdr & 0x0c) {
+	case 0x00:
+		return "";
+	case 0x04:
+		return "Start";
+	case 0x08:
+		return "Cont";
+	case 0x0c:
+		return "End";
+	default:
+		return "Unk";
+	}
+}
+
 void avctp_dump(int level, struct frame *frm)
 {
+	uint8_t hdr;
+	uint16_t pid;
+
 	p_indent(level, frm);
-	printf("AVCTP:\n");
 
-	raw_dump(level, frm);
+	hdr = get_u8(frm);
+	pid = get_u16(frm);
+
+	printf("AVCTP: %s %s: pt 0x%02x transaction %d pid 0x%04x \n",
+				hdr & 0x02 ? "Response" : "Command",
+				pt2str(hdr), hdr & 0x0c, hdr >> 4, pid);
+
+	raw_dump(level + 1, frm);
 }