static struct bgscan_timer_data *__netconfig_wifi_bgscan_get_bgscan_data(void)
{
- static struct bgscan_timer_data timer_data =
- {SCAN_EXPONENTIAL_MIN, WIFI_BGSCAN_MODE_EXPONENTIAL, 0};
+ static struct bgscan_timer_data timer_data = {
+ SCAN_EXPONENTIAL_MIN, WIFI_BGSCAN_MODE_EXPONENTIAL, 0};
return &timer_data;
}
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;
if (__netconfig_wifi_bgscan_get_mode() == WIFI_BGSCAN_MODE_EXPONENTIAL)
return TRUE;
- if (state == NETCONFIG_WIFI_ASSOCIATION ||state == NETCONFIG_WIFI_CONFIGURATION) {
+ if (state == NETCONFIG_WIFI_ASSOCIATION || state == NETCONFIG_WIFI_CONFIGURATION) {
/* During Wi-Fi connecting, Wi-Fi can be disappeared.
* After 1 sec, try scan even if connecting state */
if (retries < 2)
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;
int pm_state = VCONFKEY_PM_STATE_NORMAL;
old_mode = __netconfig_wifi_bgscan_get_mode();
- if (old_mode == scan_mode){
+ if (old_mode == scan_mode) {
wifi_complete_set_bgscan(wifi, context);
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
{
netconfig_wifi_set_bgscan_pause(FALSE);
- wifi_complete_resume_bgscan (wifi, context);
+ wifi_complete_resume_bgscan(wifi, context);
return TRUE;
}