diff options
author | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-02-17 19:00:45 -0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2011-02-17 15:59:45 -0800 |
commit | e7f8041acd12f9d10b2eb153222f37d05ccc8d19 (patch) | |
tree | 21f0d8b57567bd5959e60c5f9e8a978d951ea43a | |
parent | f7d4643cc551841815f621bfc86b7b1ece46be54 (diff) | |
download | ofono-e7f8041acd12f9d10b2eb153222f37d05ccc8d19.tar.bz2 |
bluetooth: move find_adapter_cb to better place.
-rw-r--r-- | plugins/bluetooth.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/plugins/bluetooth.c b/plugins/bluetooth.c index 175ebaa6..32be96e6 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; |