[PATCH BlueZ 3/4] android/avrcp-lib: Add avrcp_set_volume function

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

 



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

This adds avrcp_set_volume function which can be used to send
SetAbsoluteVolume PDUs.
---
 android/avrcp-lib.c | 9 +++++++++
 android/avrcp-lib.h | 2 ++
 2 files changed, 11 insertions(+)

diff --git a/android/avrcp-lib.c b/android/avrcp-lib.c
index a5530ec..bd1e7da 100644
--- a/android/avrcp-lib.c
+++ b/android/avrcp-lib.c
@@ -416,6 +416,15 @@ int avrcp_get_play_status(struct avrcp *session, avctp_rsp_cb func,
 				user_data);
 }
 
+int avrcp_set_volume(struct avrcp *session, uint8_t volume, avctp_rsp_cb func,
+							void *user_data)
+{
+	return avrcp_send_req(session, AVC_CTYPE_CONTROL, AVC_SUBUNIT_PANEL,
+						AVRCP_SET_ABSOLUTE_VOLUME,
+						&volume, sizeof(volume),
+						func, user_data);
+}
+
 int avrcp_get_play_status_rsp(struct avrcp *session, uint8_t transaction,
 				uint32_t position, uint32_t duration,
 				uint8_t status)
diff --git a/android/avrcp-lib.h b/android/avrcp-lib.h
index 4a49fe7..30d220e 100644
--- a/android/avrcp-lib.h
+++ b/android/avrcp-lib.h
@@ -148,6 +148,8 @@ int avrcp_get_current_player_value(struct avrcp *session, uint8_t *attrs,
 					void *user_data);
 int avrcp_get_play_status(struct avrcp *session, avctp_rsp_cb func,
 							void *user_data);
+int avrcp_set_volume(struct avrcp *session, uint8_t volume, avctp_rsp_cb func,
+							void *user_data);
 
 int avrcp_get_play_status_rsp(struct avrcp *session, uint8_t transaction,
 				uint32_t position, uint32_t duration,
-- 
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