aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2011-08-01 11:42:13 +0300
committerJohan Hedberg <johan.hedberg@intel.com>2011-08-03 13:59:48 +0300
commitf8abe43fbb2b79a318d2603eb689f29e1dfeb8e8 (patch)
tree410dac7fb4d947c8c6359ed45169c1cd6d0887a0
parent5d12343f44d5a64c7faf5be0d4cfc37455e188a8 (diff)
downloadbluez-hcidump-f8abe43fbb2b79a318d2603eb689f29e1dfeb8e8.tar.gz
bluez-hcidump-f8abe43fbb2b79a318d2603eb689f29e1dfeb8e8.tar.xz
bluez-hcidump-f8abe43fbb2b79a318d2603eb689f29e1dfeb8e8.zip
Add parsing for AVRCP GetPlayerApplicationSettingValueText PDU
-rw-r--r--parser/avrcp.c76
1 files changed, 76 insertions, 0 deletions
diff --git a/parser/avrcp.c b/parser/avrcp.c
index eceeac8..c9a838d 100644
--- a/parser/avrcp.c
+++ b/parser/avrcp.c
@@ -744,6 +744,79 @@ response:
}
}
+static void avrcp_get_player_value_text_dump(int level, struct frame *frm,
+ uint8_t ctype, uint16_t len)
+{
+ static uint8_t attr = 0; /* Remember attribute */
+ uint8_t num;
+
+ p_indent(level, frm);
+
+ if (len < 1) {
+ printf("PDU Malformed\n");
+ raw_dump(level, frm);
+ return;
+ }
+
+ if (ctype > AVC_CTYPE_GENERAL_INQUIRY)
+ goto response;
+
+ attr = get_u8(frm);
+ printf("AttributeID: 0x%02x (%s)\n", attr, attr2str(attr));
+
+ p_indent(level, frm);
+
+ num = get_u8(frm);
+ printf("ValueCount: 0x%02x\n", num);
+
+ for (; num > 0; num--) {
+ uint8_t value;
+
+ p_indent(level, frm);
+
+ value = get_u8(frm);
+ printf("ValueID: 0x%02x (%s)\n", value,
+ value2str(attr, value));
+ }
+
+ return;
+
+response:
+ num = get_u8(frm);
+ printf("ValueCount: 0x%02x\n", num);
+
+ for (; num > 0; num--) {
+ uint8_t value, len;
+ uint16_t charset;
+
+ p_indent(level, frm);
+
+ value = get_u8(frm);
+ printf("ValueID: 0x%02x (%s)\n", value,
+ value2str(attr, value));
+
+ p_indent(level, frm);
+
+ charset = get_u16(frm);
+ printf("CharsetID: 0x%04x (%s)\n", charset,
+ charset2str(charset));
+
+ p_indent(level, frm);
+
+ len = get_u8(frm);
+ printf("StringLength: 0x%02x\n", len);
+
+ p_indent(level, frm);
+
+ printf("String: ");
+ for (; len > 0; len--) {
+ uint8_t c = get_u8(frm);
+ printf("%1c", isprint(c) ? c : '.');
+ }
+ printf("\n");
+ }
+}
+
static void avrcp_pdu_dump(int level, struct frame *frm, uint8_t ctype)
{
uint8_t pduid, pt;
@@ -790,6 +863,9 @@ static void avrcp_pdu_dump(int level, struct frame *frm, uint8_t ctype)
avrcp_get_player_attribute_text_dump(level + 1, frm, ctype,
len);
break;
+ case AVRCP_GET_PLAYER_VALUE_TEXT:
+ avrcp_get_player_value_text_dump(level + 1, frm, ctype, len);
+ break;
default:
raw_dump(level, frm);
}