linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ 5/8] core: Make use of g_dbus_send_message_with_reply
Date: Mon, 19 Aug 2013 17:32:56 +0300	[thread overview]
Message-ID: <1376922779-11802-7-git-send-email-luiz.dentz@gmail.com> (raw)
In-Reply-To: <1376922779-11802-1-git-send-email-luiz.dentz@gmail.com>

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

This replaces dbus_connection_send_with_reply with
g_dbus_send_message_with_reply which does not alter message order.
---
 src/agent.c   | 12 ++++++------
 src/profile.c |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/agent.c b/src/agent.c
index b9e6e8c..7880ba6 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -370,7 +370,7 @@ static int agent_call_authorize_service(struct agent_request *req,
 				DBUS_TYPE_STRING, &uuid,
 				DBUS_TYPE_INVALID);
 
-	if (dbus_connection_send_with_reply(btd_get_dbus_connection(),
+	if (g_dbus_send_message_with_reply(btd_get_dbus_connection(),
 						req->msg, &req->call,
 						REQUEST_TIMEOUT) == FALSE) {
 		error("D-Bus send failed");
@@ -480,7 +480,7 @@ static int pincode_request_new(struct agent_request *req, const char *device_pat
 	dbus_message_append_args(req->msg, DBUS_TYPE_OBJECT_PATH, &device_path,
 					DBUS_TYPE_INVALID);
 
-	if (dbus_connection_send_with_reply(btd_get_dbus_connection(), req->msg,
+	if (g_dbus_send_message_with_reply(btd_get_dbus_connection(), req->msg,
 					&req->call, REQUEST_TIMEOUT) == FALSE) {
 		error("D-Bus send failed");
 		return -EIO;
@@ -574,7 +574,7 @@ static int passkey_request_new(struct agent_request *req,
 	dbus_message_append_args(req->msg, DBUS_TYPE_OBJECT_PATH, &device_path,
 					DBUS_TYPE_INVALID);
 
-	if (dbus_connection_send_with_reply(btd_get_dbus_connection(), req->msg,
+	if (g_dbus_send_message_with_reply(btd_get_dbus_connection(), req->msg,
 					&req->call, REQUEST_TIMEOUT) == FALSE) {
 		error("D-Bus send failed");
 		return -EIO;
@@ -632,7 +632,7 @@ static int confirmation_request_new(struct agent_request *req,
 				DBUS_TYPE_UINT32, &passkey,
 				DBUS_TYPE_INVALID);
 
-	if (dbus_connection_send_with_reply(btd_get_dbus_connection(), req->msg,
+	if (g_dbus_send_message_with_reply(btd_get_dbus_connection(), req->msg,
 				&req->call, REQUEST_TIMEOUT) == FALSE) {
 		error("D-Bus send failed");
 		return -EIO;
@@ -689,7 +689,7 @@ static int authorization_request_new(struct agent_request *req,
 				DBUS_TYPE_OBJECT_PATH, &device_path,
 				DBUS_TYPE_INVALID);
 
-	if (dbus_connection_send_with_reply(btd_get_dbus_connection(), req->msg,
+	if (g_dbus_send_message_with_reply(btd_get_dbus_connection(), req->msg,
 				&req->call, REQUEST_TIMEOUT) == FALSE) {
 		error("D-Bus send failed");
 		return -EIO;
@@ -823,7 +823,7 @@ static int display_pincode_request_new(struct agent_request *req,
 					DBUS_TYPE_STRING, &pincode,
 					DBUS_TYPE_INVALID);
 
-	if (dbus_connection_send_with_reply(btd_get_dbus_connection(), req->msg,
+	if (g_dbus_send_message_with_reply(btd_get_dbus_connection(), req->msg,
 				&req->call, REQUEST_TIMEOUT) == FALSE) {
 		error("D-Bus send failed");
 		return -EIO;
diff --git a/src/profile.c b/src/profile.c
index 90c3535..57aead7 100644
--- a/src/profile.c
+++ b/src/profile.c
@@ -938,7 +938,7 @@ static bool send_new_connection(struct ext_profile *ext, struct ext_io *conn)
 
 	dbus_message_iter_close_container(&iter, &dict);
 
-	if (!dbus_connection_send_with_reply(btd_get_dbus_connection(),
+	if (!g_dbus_send_message_with_reply(btd_get_dbus_connection(),
 						msg, &conn->pending, -1)) {
 		error("%s: sending NewConnection failed", ext->name);
 		dbus_message_unref(msg);
@@ -1682,7 +1682,7 @@ static int send_disconn_req(struct ext_profile *ext, struct ext_io *conn)
 	dbus_message_append_args(msg, DBUS_TYPE_OBJECT_PATH, &path,
 							DBUS_TYPE_INVALID);
 
-	if (!dbus_connection_send_with_reply(btd_get_dbus_connection(),
+	if (!g_dbus_send_message_with_reply(btd_get_dbus_connection(),
 						msg, &conn->pending, -1)) {
 		error("%s: sending RequestDisconnection failed", ext->name);
 		dbus_message_unref(msg);
-- 
1.8.3.1


  parent reply	other threads:[~2013-08-19 14:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-19 14:32 [PATCH BlueZ 0/8] Fix message order Luiz Augusto von Dentz
2013-08-19 14:32 ` [PATCH BlueZ] build: Fix not checking readline.h for bluetooth-player Luiz Augusto von Dentz
2013-08-20 12:28   ` Luiz Augusto von Dentz
2013-08-19 14:32 ` [PATCH BlueZ 1/8] gdbus: Fix not maintaining message order for signals Luiz Augusto von Dentz
2013-08-19 23:59   ` Lucas De Marchi
2013-08-19 14:32 ` [PATCH BlueZ 2/8] gdbus: Add g_dbus_send_message_with_reply Luiz Augusto von Dentz
2013-08-19 14:32 ` [PATCH BlueZ 3/8] gdbus: Avoid calling dbus_connection_send* Luiz Augusto von Dentz
2013-08-19 14:32 ` [PATCH BlueZ 4/8] gdbus: Fix emitting PropertiesChanged twice Luiz Augusto von Dentz
2013-08-19 14:32 ` Luiz Augusto von Dentz [this message]
2013-08-19 14:32 ` [PATCH BlueZ 6/8] neard: Make use of g_dbus_send_message_with_reply Luiz Augusto von Dentz
2013-08-19 14:32 ` [PATCH BlueZ 7/8] audio/media: " Luiz Augusto von Dentz
2013-08-19 14:32 ` [PATCH BlueZ 8/8] obexd: Make use of g_dbus_send_message* 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=1376922779-11802-7-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).