]> err.no Git - mapper/commitdiff
Preparations
authorKaj-Michael Lang <milang@onion.tal.org>
Thu, 24 Jan 2008 16:48:12 +0000 (18:48 +0200)
committerKaj-Michael Lang <milang@onion.tal.org>
Thu, 24 Jan 2008 16:48:12 +0000 (18:48 +0200)
src/gps-bluetooth-hildon.c

index 65ae8d5f837a7560b8883218fa462cbb410a95e6..50337d89939322e64890031ce17796d3ae7abca7 100644 (file)
 #include "ui-common.h"
 #include "gps-conn.h"
 
-void 
-rcvr_connect_response(DBusGProxy * proxy, DBusGProxyCall * call_id)
+void
+gps_connect_response(DBusGProxy * proxy, DBusGProxyCall * call_id)
 {
 GError *error = NULL;
 gchar *fdpath = NULL;
 
-if (_conn_state == RCVR_DOWN && _rcvr_mac) {
-       if (!dbus_g_proxy_end_call(_rfcomm_req_proxy, call_id, &error, G_TYPE_STRING, &fdpath, G_TYPE_INVALID)) {
+if (_gps->io.conn==RCVR_DOWN && _gps->io.address) {
+       if (!dbus_g_proxy_end_call(_gps->io.rfcomm_req_proxy, call_id, &error, G_TYPE_STRING, &fdpath, G_TYPE_INVALID)) {
                if (error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) {
                        /* If we're already connected, it's not an error, unless
                         * they don't give us the file descriptor path, in which
@@ -53,17 +53,17 @@ if (_conn_state == RCVR_DOWN && _rcvr_mac) {
                        if (!strcmp(BTCOND_ERROR_CONNECTED, dbus_g_error_get_name(error)) || !fdpath) {
                                GtkWidget *confirm;
                                printf("Caught remote method exception %s: %s", dbus_g_error_get_name(error), error->message);
-                               rcvr_disconnect();
+                               gps_disconnect(_gps);
 
                                /* Ask user to re-connect. */
                                confirm = hildon_note_new_confirmation(GTK_WINDOW(_window), _("Failed to connect to GPS receiver. Retry?"));
 
                                if (GTK_RESPONSE_OK == gtk_dialog_run(GTK_DIALOG(confirm)))
-                                       rcvr_connect_later();   /* Try again later. */
+                                       gps_connect_later();    /* Try again later. */
                                else {
                                        gps_conn_set_state(RCVR_OFF);
                                        _enable_gps=FALSE;
-                                       set_action_activate("gps_enable", !_enable_gps);
+                                       set_action_activate("gps_enabled", !_enable_gps);
                                }
 
                                gtk_widget_destroy(confirm);
@@ -72,12 +72,12 @@ if (_conn_state == RCVR_DOWN && _rcvr_mac) {
                } else {
                        /* Unknown error. */
                        g_printerr("Error: %s\n", error->message);
-                       rcvr_disconnect();
-                       rcvr_connect_later();   /* Try again later. */
+                       gps_disconnect(_gps);
+                       gps_connect_later(_gps);        /* Try again later. */
                        return;
                }
        }
-       rcvr_connect_fd(fdpath);
+       gps_connect_fd(fdpath);
 }
 /* else { Looks like the middle of a disconnect.  Do nothing. } */
 }
@@ -101,6 +101,9 @@ dbus_g_proxy_disconnect_signal(sig_proxy, BTSEARCH_DEV_FOUND_SIG, G_CALLBACK(sca
 dbus_g_proxy_disconnect_signal(sig_proxy, BTSEARCH_SEARCH_COMPLETE_SIG, G_CALLBACK(scan_cb_search_complete), scan_info);
 }
 
+/**
+ * Request bluetooth device scan
+ */
 gint 
 scan_start_search(ScanInfo * scan_info)
 {