From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ 7/7] AVRCP: Fix parsing of SetBrowsedPlayer response
Date: Fri, 15 Feb 2013 16:02:52 +0200 [thread overview]
Message-ID: <1360936972-12952-7-git-send-email-luiz.dentz@gmail.com> (raw)
In-Reply-To: <1360936972-12952-1-git-send-email-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Folder depth is actually the byte 13 not 14 of the response.
---
profiles/audio/avrcp.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index 9833a3a..9be977e 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -1928,29 +1928,30 @@ static gboolean avrcp_set_browsed_player_rsp(struct avctp *conn,
struct avrcp *session = user_data;
struct avrcp_player *player = session->player;
struct media_player *mp = player->user_data;
+ struct avrcp_browsing_header *pdu = (void *) operands;
uint32_t items;
char **folders, *path;
uint8_t depth, count;
int i;
- if (operands[3] != AVRCP_STATUS_SUCCESS || operand_count < 13)
+ if (pdu->params[0] != AVRCP_STATUS_SUCCESS || operand_count < 13)
return FALSE;
- player->uid_counter = bt_get_be16(&operands[4]);
+ player->uid_counter = bt_get_be16(&pdu->params[1]);
- items = bt_get_be32(&operands[6]);
+ items = bt_get_be32(&pdu->params[3]);
- depth = operands[13];
+ depth = operands[9];
folders = g_new0(char *, depth + 2);
folders[0] = g_strdup("/Filesystem");
- for (i = 14, count = 1; count - 1 < depth; count++) {
+ for (i = 10, count = 1; count - 1 < depth; count++) {
char *part;
uint8_t len;
- len = operands[i++];
- part = g_memdup(&operands[i], len);
+ len = pdu->params[i++];
+ part = g_memdup(&pdu->params[i], len);
i += len;
folders[count] = part;
}
--
1.8.1.2
next prev parent reply other threads:[~2013-02-15 14:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-15 14:02 [PATCH BlueZ 1/7] AVRCP: Prefix folder name with /Filesystem Luiz Augusto von Dentz
2013-02-15 14:02 ` [PATCH BlueZ 2/7] AVRCP: Parse browsing and searching features bits Luiz Augusto von Dentz
2013-02-15 14:02 ` [PATCH BlueZ 3/7] media-api: Fix referencing to MediaLibrary instead of MediaFolder Luiz Augusto von Dentz
2013-02-15 14:02 ` [PATCH BlueZ 4/7] AVRCP: Move features to avrcp.c Luiz Augusto von Dentz
2013-02-15 14:02 ` [PATCH BlueZ 5/7] AVRCP: Create folders for /Filesystem and /NowPlaying Luiz Augusto von Dentz
2013-02-15 14:02 ` [PATCH BlueZ 6/7] AVRCP: Add support for GetItemAttributes Luiz Augusto von Dentz
2013-02-15 14:02 ` Luiz Augusto von Dentz [this message]
2013-02-15 14:45 ` [PATCH BlueZ 1/7] AVRCP: Prefix folder name with /Filesystem Johan Hedberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1360936972-12952-7-git-send-email-luiz.dentz@gmail.com \
--to=luiz.dentz@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox