[PATCH BlueZ 15/17] android/avrcp-lib: Add avrcp_get_capabilities_rsp function

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

 



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

This function can be used to generate GetCapabilities response PDUs.
---
 android/avrcp-lib.c | 16 ++++++++++++++++
 android/avrcp-lib.h |  2 ++
 2 files changed, 18 insertions(+)

diff --git a/android/avrcp-lib.c b/android/avrcp-lib.c
index cb3e61e..360da10 100644
--- a/android/avrcp-lib.c
+++ b/android/avrcp-lib.c
@@ -809,6 +809,22 @@ int avrcp_set_addressed_player(struct avrcp *session, uint16_t player_id,
 				sizeof(params), func, user_data);
 }
 
+int avrcp_get_capabilities_rsp(struct avrcp *session, uint8_t transaction,
+						uint8_t number, uint8_t *events)
+{
+	uint8_t pdu[AVRCP_EVENT_LAST];
+
+	if (number > AVRCP_EVENT_LAST)
+		return -EINVAL;
+
+	pdu[0] = number;
+	memcpy(&pdu[1], events, number);
+
+	return avrcp_send(session, transaction, AVC_CTYPE_STABLE,
+				AVC_SUBUNIT_PANEL, AVRCP_GET_CAPABILITIES,
+				pdu, number + 1);
+}
+
 int avrcp_list_player_attributes_rsp(struct avrcp *session, uint8_t transaction,
 					uint8_t number, uint8_t *attrs)
 {
diff --git a/android/avrcp-lib.h b/android/avrcp-lib.h
index 8fb7152..30c7184 100644
--- a/android/avrcp-lib.h
+++ b/android/avrcp-lib.h
@@ -230,6 +230,8 @@ int avrcp_get_element_attributes(struct avrcp *session, avctp_rsp_cb func,
 int avrcp_set_addressed_player(struct avrcp *session, uint16_t player_id,
 					avctp_rsp_cb func, void *user_data);
 
+int avrcp_get_capabilities_rsp(struct avrcp *session, uint8_t transaction,
+					uint8_t number, uint8_t *events);
 int avrcp_list_player_attributes_rsp(struct avrcp *session, uint8_t transaction,
 					uint8_t number, uint8_t *attrs);
 int avrcp_get_player_attribute_text_rsp(struct avrcp *session,
-- 
1.8.5.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