diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2011-08-01 11:42:14 +0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2012-12-17 23:53:04 +0100 |
commit | c8f6b6b2b77a12cc8f9332b390240ed4b7cd93df (patch) | |
tree | 1a18e2d9cf98293f0c51475544a8c1973faef882 | |
parent | 86eb8b3956bf4a1cda624ab16397afdbcc559388 (diff) |
hcidump: Add parsing for AVRCP InformDisplayableCharacterSet PDU
-rw-r--r-- | tools/parser/avrcp.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tools/parser/avrcp.c b/tools/parser/avrcp.c index c9a838d16..53d8be247 100644 --- a/tools/parser/avrcp.c +++ b/tools/parser/avrcp.c @@ -817,6 +817,36 @@ response: } } +static void avrcp_displayable_charset(int level, struct frame *frm, + uint8_t ctype, uint16_t len) +{ + uint8_t num; + + if (ctype > AVC_CTYPE_GENERAL_INQUIRY) + return; + + p_indent(level, frm); + + if (len < 2) { + printf("PDU Malformed\n"); + raw_dump(level, frm); + return; + } + + num = get_u8(frm); + printf("CharsetCount: 0x%02x\n", num); + + for (; num > 0; num--) { + uint16_t charset; + + p_indent(level, frm); + + charset = get_u16(frm); + printf("CharsetID: 0x%04x (%s)\n", charset, + charset2str(charset)); + } +} + static void avrcp_pdu_dump(int level, struct frame *frm, uint8_t ctype) { uint8_t pduid, pt; @@ -866,6 +896,9 @@ static void avrcp_pdu_dump(int level, struct frame *frm, uint8_t ctype) case AVRCP_GET_PLAYER_VALUE_TEXT: avrcp_get_player_value_text_dump(level + 1, frm, ctype, len); break; + case AVRCP_DISPLAYABLE_CHARSET: + avrcp_displayable_charset(level + 1, frm, ctype, len); + break; default: raw_dump(level, frm); } |