Linux bluetooth development
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ 3/4] android/avrcp-lib: Add avrcp_set_volume function
Date: Fri,  7 Mar 2014 14:15:42 +0200	[thread overview]
Message-ID: <1394194543-3095-3-git-send-email-luiz.dentz@gmail.com> (raw)
In-Reply-To: <1394194543-3095-1-git-send-email-luiz.dentz@gmail.com>

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

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


  parent reply	other threads:[~2014-03-07 12:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-07 12:15 [PATCH BlueZ 1/4] android/avrcp-lib: Add avrcp_register_notification function Luiz Augusto von Dentz
2014-03-07 12:15 ` [PATCH BlueZ 2/4] android/avrcp: Add support to receive volume changed notifications Luiz Augusto von Dentz
2014-03-07 12:15 ` Luiz Augusto von Dentz [this message]
2014-03-07 12:15 ` [PATCH BlueZ 4/4] android/avrcp: Add support to set volume command Luiz Augusto von Dentz
2014-03-07 12:22 ` [PATCH BlueZ 1/4] android/avrcp-lib: Add avrcp_register_notification function Andrei Emeltchenko
2014-03-07 13:00   ` Luiz Augusto von Dentz
2014-03-07 13:09     ` Andrei Emeltchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1394194543-3095-3-git-send-email-luiz.dentz@gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox