Diff between 28d3faafee09d2966c6d4386fad6243cd94ad7e0 and bebc44c40990e0bec2ce47eab632aee194d99962

Changed Files

File Additions Deletions Status
tools/parser/avrcp.c +41 -0 modified

Full Patch

diff --git a/tools/parser/avrcp.c b/tools/parser/avrcp.c
index 40e7470..23f8a3e 100644
--- a/tools/parser/avrcp.c
+++ b/tools/parser/avrcp.c
@@ -1396,6 +1396,44 @@ response:
 	printf("Status: 0x%02x (%s)\n", status, error2str(status));
 }
 
+static void avrcp_add_to_now_playing_dump(int level, struct frame *frm,
+						uint8_t ctype, uint16_t len)
+{
+	uint64_t uid;
+	uint32_t uidcounter;
+	uint8_t scope, status;
+
+	p_indent(level, frm);
+
+	if (ctype > AVC_CTYPE_GENERAL_INQUIRY)
+		goto response;
+
+	if (len < 11) {
+		printf("PDU Malformed\n");
+		raw_dump(level, frm);
+		return;
+	}
+
+	scope = get_u8(frm);
+	printf("Scope: 0x%02x (%s)\n", scope, scope2str(scope));
+
+	p_indent(level, frm);
+
+	uid = get_u64(frm);
+	printf("UID: 0x%16" PRIx64 " (%" PRIu64 ")\n", uid, uid);
+
+	p_indent(level, frm);
+
+	uidcounter = get_u16(frm);
+	printf("UIDCounter: 0x%04x (%u)\n", uidcounter, uidcounter);
+
+	return;
+
+response:
+	status = get_u8(frm);
+	printf("Status: 0x%02x (%s)\n", status, error2str(status));
+}
+
 static void avrcp_pdu_dump(int level, struct frame *frm, uint8_t ctype)
 {
 	uint8_t pduid, pt;
@@ -1471,6 +1509,9 @@ static void avrcp_pdu_dump(int level, struct frame *frm, uint8_t ctype)
 	case AVRCP_PLAY_ITEM:
 		avrcp_play_item_dump(level + 1, frm, ctype, len);
 		break;
+	case AVRCP_ADD_TO_NOW_PLAYING:
+		avrcp_add_to_now_playing_dump(level + 1, frm, ctype, len);
+		break;
 	default:
 		raw_dump(level, frm);
 	}