From c9b11a2e7b3bdcd1b1958a9ddad56307bd28ca99 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 8 Oct 2013 13:39:26 -0700 Subject: [PATCH] monitor: Add decoding for major class audio/video values --- monitor/packet.c | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/monitor/packet.c b/monitor/packet.c index d8ac9cd49..7e6032853 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -594,6 +594,42 @@ static const char *major_class_phone(uint8_t minor) return NULL; } +static const struct { + uint8_t val; + const char *str; +} major_class_av_table[] = { + { 0x00, "Uncategorized, code for device not assigned" }, + { 0x01, "earable Headset Device" }, + { 0x02, "Hands-free Device" }, + { 0x04, "Microphone" }, + { 0x05, "Loudspeaker" }, + { 0x06, "Headphones" }, + { 0x07, "Portable Audio" }, + { 0x08, "Car audio" }, + { 0x09, "Set-top box" }, + { 0x0a, "HiFi Audio Device" }, + { 0x0b, "VCR" }, + { 0x0c, "Video Camera" }, + { 0x0d, "Camcorder" }, + { 0x0e, "Video Monitor" }, + { 0x0f, "Video Display and Loudspeaker" }, + { 0x10, "Video Conferencing" }, + { 0x12, "Gaming/Toy" }, + { } +}; + +static const char *major_class_av(uint8_t minor) +{ + int i; + + for (i = 0; major_class_av_table[i].str; i++) { + if (major_class_av_table[i].val == minor) + return major_class_av_table[i].str; + } + + return NULL; +} + static const struct { uint8_t val; const char *str; @@ -629,7 +665,8 @@ static const struct { { 0x02, "Phone (cellular, cordless, payphone, modem)", major_class_phone }, { 0x03, "LAN /Network Access point" }, - { 0x04, "Audio/Video (headset, speaker, stereo, video, vcr)" }, + { 0x04, "Audio/Video (headset, speaker, stereo, video, vcr)", + major_class_av }, { 0x05, "Peripheral (mouse, joystick, keyboards)" }, { 0x06, "Imaging (printing, scanner, camera, display)" }, { 0x07, "Wearable", major_class_wearable }, -- 2.47.3