From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ 1/4] android/avrcp-lib: Add avrcp_register_notification function
Date: Fri, 7 Mar 2014 14:15:40 +0200 [thread overview]
Message-ID: <1394194543-3095-1-git-send-email-luiz.dentz@gmail.com> (raw)
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This adds avrcp_register_notification which can be used to send
RegisterNotification PDUs.
---
android/avrcp-lib.c | 15 +++++++++++++++
android/avrcp-lib.h | 3 +++
2 files changed, 18 insertions(+)
diff --git a/android/avrcp-lib.c b/android/avrcp-lib.c
index d66560b..a5530ec 100644
--- a/android/avrcp-lib.c
+++ b/android/avrcp-lib.c
@@ -334,6 +334,21 @@ int avrcp_get_capabilities(struct avrcp *session, uint8_t param,
func, user_data);
}
+int avrcp_register_notification(struct avrcp *session, uint8_t event,
+ uint32_t interval, avctp_rsp_cb func,
+ void *user_data)
+{
+ uint8_t params[5];
+
+ params[0] = event;
+ bt_put_be32(interval, ¶ms[1]);
+
+ return avrcp_send_req(session, AVC_CTYPE_NOTIFY, AVC_SUBUNIT_PANEL,
+ AVRCP_REGISTER_NOTIFICATION,
+ params, sizeof(params),
+ func, user_data);
+}
+
int avrcp_list_player_attributes(struct avrcp *session, avctp_rsp_cb func,
void *user_data)
{
diff --git a/android/avrcp-lib.h b/android/avrcp-lib.h
index ba1d84a..4a49fe7 100644
--- a/android/avrcp-lib.h
+++ b/android/avrcp-lib.h
@@ -132,6 +132,9 @@ int avrcp_send(struct avrcp *session, uint8_t transaction, uint8_t code,
uint8_t *params, size_t params_len);
int avrcp_get_capabilities(struct avrcp *session, uint8_t param,
avctp_rsp_cb func, void *user_data);
+int avrcp_register_notification(struct avrcp *session, uint8_t event,
+ uint32_t interval, avctp_rsp_cb func,
+ void *user_data);
int avrcp_list_player_attributes(struct avrcp *session, avctp_rsp_cb func,
void *user_data);
int avrcp_get_player_attribute_text(struct avrcp *session, uint8_t *attributes,
--
1.8.5.3
next 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 Luiz Augusto von Dentz [this message]
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 ` [PATCH BlueZ 3/4] android/avrcp-lib: Add avrcp_set_volume function Luiz Augusto von Dentz
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-1-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