Linux bluetooth development
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ 1/2] android/hal-avrcp: Fill attributes in case of empty for GetElementAttributes
Date: Sun,  9 Mar 2014 13:24:44 +0200	[thread overview]
Message-ID: <1394364285-684-1-git-send-email-luiz.dentz@gmail.com> (raw)

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This has to be done since the upper layer to not interpret empty list as
get all attributes.
---
 android/hal-avrcp.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/android/hal-avrcp.c b/android/hal-avrcp.c
index 5f98f5b..0a5f500 100644
--- a/android/hal-avrcp.c
+++ b/android/hal-avrcp.c
@@ -134,11 +134,19 @@ static void handle_get_element_attrs(void *buf, uint16_t len)
 	if (!cbs->get_element_attr_cb)
 		return;
 
+	/* Set everything in case of empty list */
+	if (ev->number == 0) {
+		for (i = 0; i < BTRC_MAX_APP_SETTINGS; i++)
+			attrs[i] = i;
+		goto done;
+	}
+
 	/* Convert uint8_t array to btrc_media_attr_t array */
 	for (i = 0; i < ev->number; i++)
 		attrs[i] = ev->attrs[i];
 
-	cbs->get_element_attr_cb(ev->number, attrs);
+done:
+	cbs->get_element_attr_cb(i, attrs);
 }
 
 static void handle_register_notification(void *buf, uint16_t len)
-- 
1.8.5.3


             reply	other threads:[~2014-03-09 11:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-09 11:24 Luiz Augusto von Dentz [this message]
2014-03-09 11:24 ` [PATCH BlueZ 2/2] android/avrcp: Fix not handling SetAbsoluteVolume response Luiz Augusto von Dentz

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=1394364285-684-1-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