[PATCH BlueZ 2/8] android/avrcp-lib: Fix AddressedPlayerChanged

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

This adds proper handling for AddressedPlayerChanged in
avrcp_register_notification_rsp.
---
 android/avrcp-lib.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/android/avrcp-lib.c b/android/avrcp-lib.c
index 8350497..a487668 100644
--- a/android/avrcp-lib.c
+++ b/android/avrcp-lib.c
@@ -3243,6 +3243,7 @@ int avrcp_register_notification_rsp(struct avrcp *session, uint8_t transaction,
 					void *data, size_t len)
 {
 	struct iovec iov[2];
+	uint16_t *player;
 
 	if (event > AVRCP_EVENT_LAST)
 		return -EINVAL;
@@ -3269,6 +3270,14 @@ int avrcp_register_notification_rsp(struct avrcp *session, uint8_t transaction,
 		put_be32(*(uint32_t *) data, data);
 		break;
 	case AVRCP_EVENT_ADDRESSED_PLAYER_CHANGED:
+		if (len != 4)
+			return -EINVAL;
+
+		player = data;
+		put_be16(player[0], &player[0]);
+		put_be16(player[1], &player[1]);
+
+		break;
 	case AVRCP_EVENT_SETTINGS_CHANGED:
 		if (len < sizeof(uint8_t))
 			return -EINVAL;
-- 
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux