Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/2] android/hal-avrcp: Fill attributes in case of empty for GetElementAttributes
@ 2014-03-09 11:24 Luiz Augusto von Dentz
  2014-03-09 11:24 ` [PATCH BlueZ 2/2] android/avrcp: Fix not handling SetAbsoluteVolume response Luiz Augusto von Dentz
  0 siblings, 1 reply; 2+ messages in thread
From: Luiz Augusto von Dentz @ 2014-03-09 11:24 UTC (permalink / raw)
  To: linux-bluetooth

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-03-09 11:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-09 11:24 [PATCH BlueZ 1/2] android/hal-avrcp: Fill attributes in case of empty for GetElementAttributes Luiz Augusto von Dentz
2014-03-09 11:24 ` [PATCH BlueZ 2/2] android/avrcp: Fix not handling SetAbsoluteVolume response Luiz Augusto von Dentz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox