diff options
author | Vikrampal Yadav <vikram.pal@samsung.com> | 2014-08-13 17:35:17 +0530 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2014-08-14 18:10:55 +0300 |
commit | 58a2c3c0b6f5f96f1905d1f7b4ffb7fa69142ebb (patch) | |
tree | 31ebd8ca38b86980a6b86914b4d4d14dbf5a52f9 /monitor/avctp.c | |
parent | 4b581988b0c5fcd35f73c0a5c5d9dd35ca03fbff (diff) | |
download | bluez-58a2c3c0b6f5f96f1905d1f7b4ffb7fa69142ebb.tar.gz |
monitor: Add AVRCP ListPlayerApplicationSettingAttributes support
Support for decoding AVRCP ListPlayerApplicationSettingAttributes
added in Bluetooth monitor.
Diffstat (limited to 'monitor/avctp.c')
-rw-r--r-- | monitor/avctp.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/monitor/avctp.c b/monitor/avctp.c index 4f8783786..9df8e7596 100644 --- a/monitor/avctp.c +++ b/monitor/avctp.c @@ -150,6 +150,13 @@ #define AVRCP_PACKET_TYPE_CONTINUING 0x02 #define AVRCP_PACKET_TYPE_END 0x03 +/* player attributes */ +#define AVRCP_ATTRIBUTE_ILEGAL 0x00 +#define AVRCP_ATTRIBUTE_EQUALIZER 0x01 +#define AVRCP_ATTRIBUTE_REPEAT_MODE 0x02 +#define AVRCP_ATTRIBUTE_SHUFFLE 0x03 +#define AVRCP_ATTRIBUTE_SCAN 0x04 + static const char *ctype2str(uint8_t ctype) { switch (ctype & 0x0f) { @@ -404,6 +411,24 @@ static const char *pt2str(uint8_t pt) } } +static const char *attr2str(uint8_t attr) +{ + switch (attr) { + case AVRCP_ATTRIBUTE_ILEGAL: + return "Illegal"; + case AVRCP_ATTRIBUTE_EQUALIZER: + return "Equalizer ON/OFF Status"; + case AVRCP_ATTRIBUTE_REPEAT_MODE: + return "Repeat Mode Status"; + case AVRCP_ATTRIBUTE_SHUFFLE: + return "Shuffle ON/OFF Status"; + case AVRCP_ATTRIBUTE_SCAN: + return "Scan ON/OFF Status"; + default: + return "Unknown"; + } +} + static void avrcp_passthrough_packet(const struct l2cap_frame *frame) { } @@ -457,6 +482,22 @@ static void avrcp_list_player_attributes(const struct l2cap_frame *frame, uint8_t ctype, uint8_t len, uint8_t indent) { + uint8_t num; + int i; + + if (len == 0) + return; + + num = *((uint8_t *) frame->data); + print_field("%*cAttributeCount: 0x%02x", (indent - 8), ' ', num); + + for (i = 0; num > 0; num--, i++) { + uint8_t attr; + + attr = *((uint8_t *) (frame->data + 1 + i)); + print_field("%*cAttributeID: 0x%02x (%s)", (indent - 8), ' ', + attr, attr2str(attr)); + } } static void avrcp_list_player_values(const struct l2cap_frame *frame, |