*/
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <vconf.h>
#include <vconf-keys.h>
#include "netdbus.h"
#include "neterror.h"
#include "wifi-wps.h"
+#include "wifi-bssid-scan.h"
#include "wifi-agent.h"
#include "wifi-power.h"
#include "wifi-state.h"
#include "network-state.h"
#include "cellular-state.h"
#include "signal-handler.h"
-#include "wifi-ssid-scan.h"
#include "wifi-background-scan.h"
#include "wifi-tdls.h"
g_variant_iter_init(&iter, dictionary);
while (g_variant_iter_loop(&iter, "{sv}", &key, &var)) {
if (g_strcmp0(key, "Address") == 0) {
- value = g_variant_get_string(var, NULL);
+ g_variant_get(var, "&s", &value);
char *old_ip = vconf_get_str(VCONFKEY_NETWORK_IP);
DBG("Old IPv4.Address [%s] Received new IPv4.Address [%s]", old_ip, value);
if (g_strcmp0(old_ip, value) != 0) {
- if (value == NULL)
- vconf_set_str(VCONFKEY_NETWORK_IP, "");
- else
+ if (value != NULL)
vconf_set_str(VCONFKEY_NETWORK_IP, value);
+ else if (old_ip != NULL && strlen(old_ip) > 0)
+ vconf_set_str(VCONFKEY_NETWORK_IP, "");
}
- g_free(old_ip);
+ free(old_ip);
}
}
}
g_variant_iter_init(&iter, dictionary);
while (g_variant_iter_loop(&iter, "{sv}", &key, &var)) {
if (g_strcmp0(key, "Address") == 0) {
- value = g_variant_get_string(var, NULL);
- char *old_ip6 = vconf_get_str(VCONFKEY_NETWORK_IP);
+ g_variant_get(var, "&s", &value);
+ char *old_ip6 = vconf_get_str(VCONFKEY_NETWORK_IP6);
DBG("Old IPv6.Address [%s] Received new IPv6.Address [%s]", old_ip6, value);
if (g_strcmp0(old_ip6, value) != 0) {
- if (value == NULL)
- vconf_set_str(VCONFKEY_NETWORK_IP6, "");
- else
+ if (value != NULL)
vconf_set_str(VCONFKEY_NETWORK_IP6, value);
+ else if (old_ip6 != NULL && strlen(old_ip6) > 0)
+ vconf_set_str(VCONFKEY_NETWORK_IP6, "");
}
- g_free(old_ip6);
+ free(old_ip6);
}
}
}
const gchar *sig, GVariant *param, gpointer user_data)
{
DBG("Interface removed handling!");
- if (netconfig_wifi_is_wps_enabled() == TRUE)
- netconfig_wifi_wps_signal_scanaborted();
+ if (netconfig_wifi_is_bssid_scan_started() == TRUE)
+ netconfig_wifi_bssid_signal_scanaborted();
return;
}
const gchar *name, const gchar *path, const gchar *interface,
const gchar *sig, GVariant *param, gpointer user_data)
{
- DBG("Properties changed handling!");
gchar *key;
GVariantIter *iter;
GVariant *variant;
while (g_variant_iter_loop(iter, "{sv}", &key, &variant)) {
if (g_strcmp0(key, "Scanning") == 0) {
scanning = g_variant_get_boolean(variant);
+ DBG("setting scanning %s", scanning ? "TRUE" : "FALSE");
if (scanning == TRUE)
netconfig_wifi_set_scanning(TRUE);
+ else
+ netconfig_wifi_set_scanning(FALSE);
g_variant_unref(variant);
g_free(key);
const gchar *sig, GVariant *param, gpointer user_data)
{
DBG("BSS added handling!");
- if (wifi_ssid_scan_get_state() == TRUE)
- wifi_ssid_scan_add_bss(param);
- else
- wifi_state_set_bss_found(TRUE);
+ wifi_state_set_bss_found(TRUE);
return;
}
DBG("Scan Done handling!");
netconfig_wifi_set_scanning(FALSE);
- if (netconfig_wifi_is_wps_enabled() == TRUE) {
- netconfig_wifi_wps_signal_scandone();
+ if (netconfig_wifi_is_bssid_scan_started() == TRUE) {
+ netconfig_wifi_bssid_signal_scandone();
if (wifi_state_get_technology_state() < NETCONFIG_WIFI_TECH_POWERED)
return;
}
- if (netconfig_wifi_get_bgscan_state() != TRUE) {
- if (wifi_ssid_scan_get_state() == TRUE)
- wifi_ssid_scan_emit_scan_completed();
- else
- wifi_ssid_scan(NULL);
- } else {
+ if (netconfig_wifi_get_bgscan_state() == TRUE) {
if (wifi_state_get_technology_state() >=
NETCONFIG_WIFI_TECH_POWERED)
netconfig_wifi_bgscan_start(FALSE);
const gchar *name, const gchar *path, const gchar *interface,
const gchar *sig, GVariant *param, gpointer user_data)
{
- ERR("Received TDLS Connected Signal");
- netconfig_wifi_tlds_connected_event(param);
+ DBG("Received TDLS Connected Signal");
+ netconfig_wifi_tdls_connected_event(param);
return;
}
const gchar *name, const gchar *path, const gchar *interface,
const gchar *sig, GVariant *param, gpointer user_data)
{
- ERR("Received TDLS Disconnected Signal");
- netconfig_wifi_tlds_disconnected_event(param);
+ DBG("Received TDLS Disconnected Signal");
+ netconfig_wifi_tdls_disconnected_event(param);
return;
}
const gchar *name, const gchar *path, const gchar *interface,
const gchar *sig, GVariant *param, gpointer user_data)
{
- ERR("Received TDLS Peer Found Signal");
+ DBG("Received TDLS Peer Found Signal");
+ netconfig_wifi_tdls_peer_found_event(param);
return;
}
g_variant_get(param, "(sa{sv})", &name, &iter);
INFO("Event Result: %s", name);
- if (g_strcmp0(name, "failed") == 0) {
+ if (g_strcmp0(name, "fail") == 0) {
while (g_variant_iter_loop(iter, "{sv}", &key, &variant)) {
if (key == NULL)
goto error;