Diff between b6d655f3d80ab069191de8f3fab8ecad6b32d38c and 7c29b18cf2062ca12e63bb285faf3d85d50ba601

Changed Files

File Additions Deletions Status
tools/parser/avdtp.c +58 -0 modified

Full Patch

diff --git a/tools/parser/avdtp.c b/tools/parser/avdtp.c
index 14dc417..5969067 100644
--- a/tools/parser/avdtp.c
+++ b/tools/parser/avdtp.c
@@ -222,6 +222,7 @@ static void capabilities(int level, struct frame *frm)
 			uint8_t type, codec;
 			uint16_t tmp, freq, vndcodec = 0;
 			uint32_t bitrate, vendor = 0;
+			int i;
 
 			type  = get_u8(frm);
 			codec = get_u8(frm);
@@ -288,6 +289,63 @@ static void capabilities(int level, struct frame *frm)
 				p_indent(level + 1, frm);
 				printf("Bitpool Range %d-%d\n", tmp, get_u8(frm));
 				break;
+			case 1:
+				tmp = get_u8(frm);
+				p_indent(level + 1, frm);
+				printf("Layers: ");
+				if (tmp & 0x80)
+					printf("1 ");
+				if (tmp & 0x40)
+					printf("2 ");
+				if (tmp & 0x20)
+					printf("3 ");
+				printf("\n");
+				p_indent(level + 1, frm);
+				printf("CRC Protection: %s\n",
+						tmp & 0x10 ? "Yes" : "No");
+				p_indent(level + 1, frm);
+				if (tmp & 0x08)
+					printf("Mono ");
+				if (tmp & 0x04)
+					printf("DualChannel ");
+				if (tmp & 0x02)
+					printf("Stereo ");
+				if (tmp & 0x01)
+					printf("JointStereo ");
+				printf("\n");
+				tmp = get_u8(frm);
+				p_indent(level + 1, frm);
+				printf("Media Payload Format: RFC-2250 %s\n",
+						tmp & 0x40 ? "RFC-3119" : "");
+				p_indent(level + 1, frm);
+				if (tmp & 0x20)
+					printf("16kHz ");
+				if (tmp & 0x10)
+					printf("22.05kHz ");
+				if (tmp & 0x08)
+					printf("24kHz ");
+				if (tmp & 0x04)
+					printf("32kHz ");
+				if (tmp & 0x02)
+					printf("44.1kHz ");
+				if (tmp & 0x01)
+					printf("48kHz ");
+				printf("\n");
+				tmp = get_u16(frm);
+				p_indent(level + 1, frm);
+				printf("VBR: %s\n",
+						tmp & 0x8000 ? "Yes" : "No");
+				p_indent(level + 1, frm);
+				printf("Bit Rate Indexes: ");
+				if (tmp & 0x8000) {
+					printf("n/a");
+				} else {
+					for (i = 0; i < 15; i++, tmp >>= 1)
+						if (tmp & 0x0001)
+							printf("%d ", i);
+				}
+				printf("\n");
+				break;
 			case 2:
 				tmp = get_u8(frm);
 				p_indent(level + 1, frm);