[PATCH BlueZ 12/13] android/hal-avrcp: Add .set_volume implementation

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

 



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

---
 android/hal-avrcp.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/android/hal-avrcp.c b/android/hal-avrcp.c
index 41349f2..469de3f 100644
--- a/android/hal-avrcp.c
+++ b/android/hal-avrcp.c
@@ -424,6 +424,21 @@ static bt_status_t register_notification_rsp(btrc_event_id_t event_id,
 	return status;
 }
 
+static bt_status_t set_volume(uint8_t volume)
+{
+	struct hal_cmd_avrcp_set_volume cmd;
+
+	DBG("");
+
+	if (!interface_ready())
+		return BT_STATUS_NOT_READY;
+
+	cmd.value = volume;
+
+	return hal_ipc_cmd(HAL_SERVICE_ID_AVRCP, HAL_OP_AVRCP_SET_VOLUME,
+					sizeof(cmd), &cmd, 0, NULL, NULL);
+}
+
 static void cleanup()
 {
 	struct hal_cmd_unregister_module cmd;
@@ -455,6 +470,7 @@ static btrc_interface_t iface = {
 	.get_element_attr_rsp = get_element_attr_rsp,
 	.set_player_app_value_rsp = set_player_app_value_rsp,
 	.register_notification_rsp = register_notification_rsp,
+	.set_volume = set_volume,
 	.cleanup = cleanup
 };
 
-- 
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