From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ 01/11] control: Fix Control.Disconnect not generating any reply
Date: Thu, 25 Oct 2012 16:59:04 +0300 [thread overview]
Message-ID: <1351173554-28039-1-git-send-email-luiz.dentz@gmail.com> (raw)
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
avctp_disconnect does disconnect immediatelly so there is no time to
set the pending message.
---
audio/control.c | 20 ++------------------
1 file changed, 2 insertions(+), 18 deletions(-)
diff --git a/audio/control.c b/audio/control.c
index 37b027b..1620128 100644
--- a/audio/control.c
+++ b/audio/control.c
@@ -65,7 +65,6 @@ struct control {
struct avctp *session;
gboolean target;
DBusMessage *connect;
- DBusMessage *disconnect;
};
static void state_changed(struct audio_device *dev, avctp_state_t old_state,
@@ -88,13 +87,6 @@ static void state_changed(struct audio_device *dev, avctp_state_t old_state,
control->connect = NULL;
}
- if (control->disconnect) {
- g_dbus_send_reply(conn, control->disconnect,
- DBUS_TYPE_INVALID);
- dbus_message_unref(control->disconnect);
- control->disconnect = NULL;
- }
-
if (old_state != AVCTP_STATE_CONNECTED)
break;
@@ -184,14 +176,9 @@ static DBusMessage *control_disconnect(DBusConnection *conn, DBusMessage *msg,
if (!control->session)
return btd_error_not_connected(msg);
- if (control->disconnect)
- return btd_error_in_progress(msg);
-
avctp_disconnect(control->session);
- control->disconnect = dbus_message_ref(msg);
-
- return NULL;
+ return dbus_message_new_method_return(msg);
}
static DBusMessage *key_pressed(DBusConnection *conn, DBusMessage *msg,
@@ -273,7 +260,7 @@ static const GDBusMethodTable control_methods[] = {
NULL, GDBUS_ARGS({ "connected", "b" }),
control_is_connected) },
{ GDBUS_ASYNC_METHOD("Connect", NULL, NULL, control_connect) },
- { GDBUS_ASYNC_METHOD("Disconnect", NULL, NULL, control_disconnect) },
+ { GDBUS_METHOD("Disconnect", NULL, NULL, control_disconnect) },
{ GDBUS_METHOD("Play", NULL, NULL, control_play) },
{ GDBUS_METHOD("Pause", NULL, NULL, control_pause) },
{ GDBUS_METHOD("Stop", NULL, NULL, control_stop) },
@@ -309,9 +296,6 @@ static void path_unregister(void *data)
if (control->connect)
dbus_message_unref(control->connect);
- if (control->disconnect)
- dbus_message_unref(control->disconnect);
-
g_free(control);
dev->control = NULL;
}
--
1.7.11.7
next reply other threads:[~2012-10-25 13:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-25 13:59 Luiz Augusto von Dentz [this message]
2012-10-25 13:59 ` [PATCH BlueZ 02/11] AVRCP: Fix using void * for metadata values Luiz Augusto von Dentz
2012-10-25 13:59 ` [PATCH BlueZ 03/11] AVRCP: Don't respond with errors when no player is registered Luiz Augusto von Dentz
2012-10-25 13:59 ` [PATCH BlueZ 04/11] AVRCP: Fix not adding session to player's list of sessions Luiz Augusto von Dentz
2012-10-25 13:59 ` [PATCH BlueZ 05/11] AVCTP: Reduce verbosity of PDU parsing Luiz Augusto von Dentz
2012-10-25 13:59 ` [PATCH BlueZ 06/11] AVRCP: Add support for settings changed event Luiz Augusto von Dentz
2012-10-25 13:59 ` [PATCH BlueZ 07/11] AVRCP: Add initial support for controller player Luiz Augusto von Dentz
2012-10-26 7:44 ` Johan Hedberg
2012-10-25 13:59 ` [PATCH BlueZ 08/11] AVRCP: Remove conversions inside media.c Luiz Augusto von Dentz
2012-10-25 13:59 ` [PATCH BlueZ 09/11] test: Fix using Number instead of Track in simple-player Luiz Augusto von Dentz
2012-10-25 13:59 ` [PATCH BlueZ 10/11] test: Fix using Number instead of Track in mpris-player Luiz Augusto von Dentz
2012-10-25 13:59 ` [PATCH BlueZ 11/11] test: Add support for using external player Luiz Augusto von Dentz
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=1351173554-28039-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;
as well as URLs for NNTP newsgroup(s).