#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
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);
} 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. } */
}
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)
{