return __netconfig_wifi_bgscan_mode(FALSE, -1);
}
+static void __netconfig_wifi_scan_request_reply(GObject *source_object, GAsyncResult *res, gpointer user_data)
+
+{
+ GVariant *reply;
+ GDBusConnection *conn = NULL;
+ GError *error = NULL;
+
+ conn = G_DBUS_CONNECTION(source_object);
+ reply = g_dbus_connection_call_finish(conn, res, &error);
+
+ if (reply == NULL) {
+ if (error != NULL) {
+ ERR("Fail to request status [%d: %s]", error->code, error->message);
+ netconfig_wifi_set_scanning(FALSE);
+ g_error_free(error);
+ } else {
+ ERR("Fail to request scan");
+ netconfig_wifi_set_scanning(FALSE);
+ }
+ } else {
+ DBG("Successfully requested");
+ }
+
+ g_variant_unref(reply);
+ netconfig_gdbus_pending_call_unref();
+}
+
static gboolean __netconfig_wifi_bgscan_request_connman_scan(int retries)
{
gboolean reply = FALSE;
reply = netconfig_invoke_dbus_method_nonblock(CONNMAN_SERVICE,
CONNMAN_WIFI_TECHNOLOGY_PREFIX,
- CONNMAN_TECHNOLOGY_INTERFACE, "Scan", NULL, NULL);
+ CONNMAN_TECHNOLOGY_INTERFACE, "Scan", NULL, __netconfig_wifi_scan_request_reply);
if (reply != TRUE)
netconfig_wifi_set_scanning(FALSE);
return FALSE;
/* In case of LCD off, we don't need Wi-Fi scan */
- vconf_get_int(VCONFKEY_PM_STATE, &pm_state);
+ netconfig_vconf_get_int(VCONFKEY_PM_STATE, &pm_state);
if (pm_state >= VCONFKEY_PM_STATE_LCDOFF)
return TRUE;
netconfig_wifi_bgscan_stop();
/* In case of LCD off, we don't need Wi-Fi scan right now */
- vconf_get_int(VCONFKEY_PM_STATE, &pm_state);
+ netconfig_vconf_get_int(VCONFKEY_PM_STATE, &pm_state);
if (pm_state >= VCONFKEY_PM_STATE_LCDOFF)
netconfig_wifi_bgscan_start(FALSE);
else
return TRUE;
}
+gboolean handle_get_autoscan(Wifi *wifi, GDBusMethodInvocation *context)
+{
+
+ gboolean autoscan = 0;
+
+ autoscan = netconfig_wifi_is_bgscan_paused();
+
+ wifi_complete_get_autoscan(wifi, context, autoscan);
+ return TRUE;
+}
+
+gboolean handle_get_autoscanmode(Wifi *wifi, GDBusMethodInvocation *context)
+{
+ guint autoscanmode = 0;
+
+ autoscanmode = __netconfig_wifi_bgscan_get_mode();
+
+ wifi_complete_get_autoscanmode(wifi, context, autoscanmode);
+ return TRUE;
+}
+