From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ 3/4] Add support for MediaPlayer.Release to mpris-player
Date: Fri, 28 Oct 2011 10:49:21 +0300 [thread overview]
Message-ID: <1319788162-5606-3-git-send-email-luiz.dentz@gmail.com> (raw)
In-Reply-To: <1319788162-5606-1-git-send-email-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
test/mpris-player.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/test/mpris-player.c b/test/mpris-player.c
index 4592e5d..a1632f3 100644
--- a/test/mpris-player.c
+++ b/test/mpris-player.c
@@ -429,6 +429,22 @@ static char *sender2path(const char *sender)
return g_strdelimit(path, ":.", '_');
}
+static DBusHandlerResult player_message(DBusConnection *conn,
+ DBusMessage *msg, void *data)
+{
+ if (dbus_message_is_method_call(msg, "org.bluez.MediaPlayer",
+ "Release")) {
+ printf("Release\n");
+ exit(1);
+ }
+
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+}
+
+static const DBusObjectPathVTable player_table = {
+ .message_function = player_message,
+};
+
static void add_player(DBusConnection *conn, const char *name,
const char *sender)
{
@@ -492,6 +508,10 @@ static void add_player(DBusConnection *conn, const char *name,
goto done;
}
+ if (!dbus_connection_register_object_path(sys, path, &player_table,
+ NULL))
+ fprintf(stderr, "Can't register object path for agent\n");
+
done:
if (reply)
dbus_message_unref(reply);
--
1.7.6.4
next prev parent reply other threads:[~2011-10-28 7:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-28 7:49 [PATCH BlueZ 1/4] Add rule to allow sending messages to MediaPlayer interface Luiz Augusto von Dentz
2011-10-28 7:49 ` [PATCH BlueZ 2/4] Add MediaPlayer.Release method Luiz Augusto von Dentz
2011-10-28 7:49 ` Luiz Augusto von Dentz [this message]
2011-10-28 7:49 ` [PATCH BlueZ 4/4] Add support for MediaPlayer.Release to simple-player Luiz Augusto von Dentz
2011-10-28 12:16 ` [PATCH BlueZ 1/4] Add rule to allow sending messages to MediaPlayer interface Johan Hedberg
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=1319788162-5606-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