Open Source Telephony
 help / color / mirror / Atom feed
* [PATCH 1/5] bluetooth: move find_adapter_cb to better place.
@ 2011-02-17 22:00 Gustavo F. Padovan
  2011-02-17 22:00 ` [PATCH 2/5] bluetooth: add a bluetoothd connect watch Gustavo F. Padovan
  2011-02-18  0:00 ` [PATCH 1/5] bluetooth: move find_adapter_cb to better place Marcel Holtmann
  0 siblings, 2 replies; 10+ messages in thread
From: Gustavo F. Padovan @ 2011-02-17 22:00 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 2085 bytes --]

---
 plugins/bluetooth.c |   52 +++++++++++++++++++++++++-------------------------
 1 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/plugins/bluetooth.c b/plugins/bluetooth.c
index 175ebaa..32be96e 100644
--- a/plugins/bluetooth.c
+++ b/plugins/bluetooth.c
@@ -633,6 +633,32 @@ static void add_record(gpointer data, gpointer user_data)
 					DBUS_TYPE_INVALID);
 }
 
+static void find_adapter_cb(DBusPendingCall *call, gpointer user_data)
+{
+	DBusMessage *reply = dbus_pending_call_steal_reply(call);
+	DBusError derr;
+	const char *path;
+
+	dbus_error_init(&derr);
+
+	if (dbus_set_error_from_message(&derr, reply)) {
+		ofono_error("Replied with an error: %s, %s",
+					derr.name, derr.message);
+		dbus_error_free(&derr);
+		goto done;
+	}
+
+	dbus_message_get_args(reply, NULL, DBUS_TYPE_OBJECT_PATH, &path,
+					DBUS_TYPE_INVALID);
+
+	adapter_any_path = g_strdup(path);
+
+	g_slist_foreach(server_list, (GFunc) add_record, NULL);
+
+done:
+	dbus_message_unref(reply);
+}
+
 static gboolean adapter_added(DBusConnection *connection, DBusMessage *message,
 				void *user_data)
 {
@@ -724,32 +750,6 @@ static void bluetooth_disconnect(DBusConnection *connection, void *user_data)
 	g_hash_table_foreach(uuid_hash, bluetooth_remove_all_modem, NULL);
 }
 
-static void find_adapter_cb(DBusPendingCall *call, gpointer user_data)
-{
-	DBusMessage *reply = dbus_pending_call_steal_reply(call);
-	DBusError derr;
-	const char *path;
-
-	dbus_error_init(&derr);
-
-	if (dbus_set_error_from_message(&derr, reply)) {
-		ofono_error("Replied with an error: %s, %s",
-					derr.name, derr.message);
-		dbus_error_free(&derr);
-		goto done;
-	}
-
-	dbus_message_get_args(reply, NULL, DBUS_TYPE_OBJECT_PATH, &path,
-					DBUS_TYPE_INVALID);
-
-	adapter_any_path = g_strdup(path);
-
-	g_slist_foreach(server_list, (GFunc) add_record, NULL);
-
-done:
-	dbus_message_unref(reply);
-}
-
 static guint bluetooth_watch;
 static guint adapter_added_watch;
 static guint adapter_removed_watch;
-- 
1.7.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-02-18  0:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-17 22:00 [PATCH 1/5] bluetooth: move find_adapter_cb to better place Gustavo F. Padovan
2011-02-17 22:00 ` [PATCH 2/5] bluetooth: add a bluetoothd connect watch Gustavo F. Padovan
2011-02-17 22:00   ` [PATCH 3/5] bluetooth: change how we report DBus errors Gustavo F. Padovan
2011-02-17 22:00     ` [PATCH 4/5] bluetooth: fix crash by removing record Gustavo F. Padovan
2011-02-17 22:00       ` [PATCH 5/5] bluetooth: add DBG() messages Gustavo F. Padovan
2011-02-18  0:03         ` Marcel Holtmann
2011-02-18  0:03       ` [PATCH 4/5] bluetooth: fix crash by removing record Marcel Holtmann
2011-02-18  0:03     ` [PATCH 3/5] bluetooth: change how we report DBus errors Marcel Holtmann
2011-02-18  0:01   ` [PATCH 2/5] bluetooth: add a bluetoothd connect watch Marcel Holtmann
2011-02-18  0:00 ` [PATCH 1/5] bluetooth: move find_adapter_cb to better place Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox