#include <osso-ic.h>
#include "iap.h"
-#include "map.h"
+#include "map-download.h"
#include "gps.h"
+#include "config-gconf.h"
gboolean iap_connecting=FALSE;
gboolean iap_connected=TRUE;
void iap_callback(struct iap_event_t *event, void *arg)
{
- printf("%s()\n", __PRETTY_FUNCTION__);
- iap_connecting = FALSE;
- if (event->type == OSSO_IAP_CONNECTED && !iap_connected) {
- iap_connected = TRUE;
- config_update_proxy();
- if (!_curl_sid)
- _curl_sid = g_timeout_add(100,
- (GSourceFunc)
- curl_download_timeout, NULL);
- }
- vprintf("%s(): return\n", __PRETTY_FUNCTION__);
+iap_connecting = FALSE;
+if (event->type == OSSO_IAP_CONNECTED && !iap_connected) {
+ iap_connected = TRUE;
+ config_update_proxy();
+ if (!_curl_sid)
+ _curl_sid = g_timeout_add(100, (GSourceFunc)map_download_timeout, NULL);
+}
}
DBusHandlerResult
get_connection_status_signal_cb(DBusConnection * connection,
DBusMessage * message, void *user_data)
{
- gchar *iap_name = NULL, *iap_nw_type = NULL, *iap_state = NULL;
- printf("%s()\n", __PRETTY_FUNCTION__);
+gchar *iap_name = NULL, *iap_nw_type = NULL, *iap_state = NULL;
- /* check signal */
- if (!dbus_message_is_signal(message,
- ICD_DBUS_INTERFACE,
- ICD_STATUS_CHANGED_SIG)) {
- vprintf("%s(): return DBUS_HANDLER_RESULT_NOT_YET_HANDLED\n",
- __PRETTY_FUNCTION__);
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
- }
+/* check signal */
+if (!dbus_message_is_signal(message, ICD_DBUS_INTERFACE, ICD_STATUS_CHANGED_SIG)) {
+ vprintf("%s(): return DBUS_HANDLER_RESULT_NOT_YET_HANDLED\n", __PRETTY_FUNCTION__);
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+}
- if (!dbus_message_get_args(message, NULL,
- DBUS_TYPE_STRING, &iap_name,
- DBUS_TYPE_STRING, &iap_nw_type,
- DBUS_TYPE_STRING, &iap_state,
- DBUS_TYPE_INVALID)) {
- vprintf("%s(): return DBUS_HANDLER_RESULT_NOT_YET_HANDLED\n",
- __PRETTY_FUNCTION__);
+if (!dbus_message_get_args(message, NULL,
+ DBUS_TYPE_STRING, &iap_name,
+ DBUS_TYPE_STRING, &iap_nw_type,
+ DBUS_TYPE_STRING, &iap_state,
+ DBUS_TYPE_INVALID)) {
+ vprintf("%s(): return DBUS_HANDLER_RESULT_NOT_YET_HANDLED\n", __PRETTY_FUNCTION__);
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
- }
+}
- printf(" > iap_state = %s\n", iap_state);
- if (!strcmp(iap_state, "CONNECTED")) {
- if (!iap_connected) {
- iap_connected = TRUE;
- config_update_proxy();
- if (!_curl_sid)
- _curl_sid = g_timeout_add(100,
- (GSourceFunc)
- curl_download_timeout,
- NULL);
+printf(" > iap_state = %s\n", iap_state);
+if (!strcmp(iap_state, "CONNECTED")) {
+ if (!iap_connected) {
+ iap_connected = TRUE;
+ config_update_proxy();
+ if (!_curl_sid)
+ _curl_sid = g_timeout_add(100, (GSourceFunc)map_download_timeout, NULL);
}
} else if (iap_connected) {
iap_connected = FALSE;
_curl_sid = 0;
}
}
-
- vprintf("%s(): return DBUS_HANDLER_RESULT_HANDLED\n",
- __PRETTY_FUNCTION__);
- return DBUS_HANDLER_RESULT_HANDLED;
+vprintf("%s(): return DBUS_HANDLER_RESULT_HANDLED\n", __PRETTY_FUNCTION__);
+return DBUS_HANDLER_RESULT_HANDLED;
}
void