Diff between 5b8d00829e44f452bf44ad8fb165da57b0570626 and 4bf61983aa30af6ac0451bf5b8bbb838f7449d66

Changed Files

File Additions Deletions Status
monitor/packet.c +25 -1 modified

Full Patch

diff --git a/monitor/packet.c b/monitor/packet.c
index 2b5d8b9..db579a2 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -500,6 +500,30 @@ static const char *major_class_phone(uint8_t minor)
 static const struct {
 	uint8_t val;
 	const char *str;
+} major_class_wearable_table[] = {
+	{ 0x01, "Wrist Watch"	},
+	{ 0x02, "Pager"		},
+	{ 0x03, "Jacket"	},
+	{ 0x04, "Helmet"	},
+	{ 0x05, "Glasses"	},
+	{ }
+};
+
+static const char *major_class_wearable(uint8_t minor)
+{
+	int i;
+
+	for (i = 0; major_class_wearable_table[i].str; i++) {
+		if (major_class_wearable_table[i].val == minor)
+			return major_class_wearable_table[i].str;
+	}
+
+	return NULL;
+}
+
+static const struct {
+	uint8_t val;
+	const char *str;
 	const char *(*func)(uint8_t minor);
 } major_class_table[] = {
 	{ 0x00, "Miscellaneous"						},
@@ -511,7 +535,7 @@ static const struct {
 	{ 0x04, "Audio/Video (headset, speaker, stereo, video, vcr)"	},
 	{ 0x05, "Peripheral (mouse, joystick, keyboards)"		},
 	{ 0x06, "Imaging (printing, scanner, camera, display)"		},
-	{ 0x07, "Wearable"						},
+	{ 0x07, "Wearable",			major_class_wearable	},
 	{ 0x08, "Toy"							},
 	{ 0x09, "Health"						},
 	{ 0x1f, "Uncategorized, specific device code not specified"	},