diff options
author | Bharat Panda <bharat.panda@samsung.com> | 2015-08-20 14:32:05 +0530 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2015-08-20 15:54:30 +0300 |
commit | 3a6a93165af29a38f47a585991c03fd357c8dc1a (patch) | |
tree | 91b0945684b3ade06c95a7f411bd6096361e0762 /monitor/avctp.c | |
parent | 4827d6b61fd4fae4d0ba2fe46c42e5021b97ca56 (diff) | |
download | bluez-3a6a93165af29a38f47a585991c03fd357c8dc1a.tar.gz |
monitor/avctp: Fix GetFolderItems field values
Replaced field names for GetFolderItems response with
correct names, values and fix allignments.
AVCTP Browsing: Response: type 0x00 label 0 PID 0x110e
AVRCP: GetFolderItems: len 0x0030
Status: 0x04 (Success)
UIDCounter: 0x0000 (0)
NumOfItems: 0x0001 (1)
Item: 0x01 (Media Player)
Length: 0x0028 (40)
PlayerID: 0x0000 (0)
PlayerType: 0x0001 (Audio)
PlayerSubType: 0x00000001 (Audio Book)
PlayStatus: 0x01 (PLAYING)
Features: 0x0000000000b701ef0200000000000000
CharsetID: 0x006a (UTF-8)
NameLength: 0x000c (12)
Name: SimplePlayer
Diffstat (limited to 'monitor/avctp.c')
-rw-r--r-- | monitor/avctp.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/monitor/avctp.c b/monitor/avctp.c index a54b051e6..d06640ea0 100644 --- a/monitor/avctp.c +++ b/monitor/avctp.c @@ -1818,9 +1818,9 @@ static bool avrcp_media_player_item(struct avctp_frame *avctp_frame, { struct l2cap_frame *frame = &avctp_frame->l2cap_frame; uint16_t id, charset, namelen; - uint8_t type, status; + uint8_t type, status, i; uint32_t subtype; - uint64_t features[2]; + uint8_t features[16]; if (!l2cap_frame_get_be16(frame, &id)) return false; @@ -1830,26 +1830,31 @@ static bool avrcp_media_player_item(struct avctp_frame *avctp_frame, if (!l2cap_frame_get_u8(frame, &type)) return false; - print_field("%*cPlayerID: 0x%04x (%s)", indent, ' ', + print_field("%*cPlayerType: 0x%04x (%s)", indent, ' ', type, playertype2str(type)); if (!l2cap_frame_get_be32(frame, &subtype)) return false; - print_field("%*cPlayerID: 0x%08x (%s)", indent, ' ', + print_field("%*cPlayerSubType: 0x%08x (%s)", indent, ' ', subtype, playersubtype2str(subtype)); if (!l2cap_frame_get_u8(frame, &status)) return false; - print_field("%*cPlayerID: 0x%02x (%s)", indent, ' ', + print_field("%*cPlayStatus: 0x%02x (%s)", indent, ' ', status, playstatus2str(status)); - if (!l2cap_frame_get_be128(frame, &features[0], &features[1])) - return false; + printf("%*cFeatures: 0x", indent+8, ' '); + + for (i = 0; i < 16; i++) { + if (!l2cap_frame_get_u8(frame, &features[i])) + return false; - print_field("%*cFeatures: 0x%16" PRIx64 "%16" PRIx64, indent, ' ', - features[1], features[0]); + printf("%02x", features[i]); + } + + printf("\n"); if (!l2cap_frame_get_be16(frame, &charset)) return false; @@ -1863,7 +1868,7 @@ static bool avrcp_media_player_item(struct avctp_frame *avctp_frame, print_field("%*cNameLength: 0x%04x (%u)", indent, ' ', namelen, namelen); - printf("%*cName: ", indent, ' '); + printf("%*cName: ", indent+8, ' '); for (; namelen > 0; namelen--) { uint8_t c; @@ -1871,6 +1876,7 @@ static bool avrcp_media_player_item(struct avctp_frame *avctp_frame, return false; printf("%1c", isprint(c) ? c : '.'); } + printf("\n"); return true; } @@ -2296,7 +2302,7 @@ response: if (!l2cap_frame_get_be16(frame, &num)) return false; - print_field("%*cUIDCounter: 0x%04x (%u)", indent, ' ', num, num); + print_field("%*cNumOfItems: 0x%04x (%u)", indent, ' ', num, num); for (; num > 0; num--) { uint8_t type; |