summaryrefslogtreecommitdiff
path: root/gsupplicant/supplicant.c
diff options
context:
space:
mode:
Diffstat (limited to 'gsupplicant/supplicant.c')
-rwxr-xr-xgsupplicant/supplicant.c63
1 files changed, 53 insertions, 10 deletions
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 4bc52762..e457fef2 100755
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -1601,6 +1601,32 @@ dbus_int16_t g_supplicant_network_get_signal(GSupplicantNetwork *network)
return network->signal;
}
+#if defined TIZEN_EXT
+void g_supplicant_network_set_signal(GSupplicantNetwork *network, int signal)
+{
+ if (!network)
+ return;
+
+ network->signal = (dbus_int16_t)signal;
+}
+
+void g_supplicant_network_set_bss_signal(GSupplicantNetwork *network,
+ int signal, int snr)
+{
+ struct g_supplicant_bss *best_bss;
+
+ if (!network)
+ return;
+
+ best_bss = network->best_bss;
+ if (!best_bss)
+ return;
+
+ best_bss->signal = (dbus_int16_t)signal;
+ best_bss->snr = (dbus_int16_t)snr;
+}
+#endif
+
dbus_uint16_t g_supplicant_network_get_frequency(GSupplicantNetwork *network)
{
if (!network)
@@ -2631,7 +2657,7 @@ static bool update_best_bss(GSupplicantNetwork *network,
#endif
if (score_new > score_best) {
- SUPPLICANT_DBG("new[" MACSTR "][%u] : best[" MACSTR "][%u]",
+ SUPPLICANT_DBG("new[" MACSTR "][%d] : best[" MACSTR "][%d]",
MAC2STR(bss->bssid), score_new,
MAC2STR(network->best_bss->bssid), score_best);
@@ -3547,6 +3573,13 @@ static void interface_current_bss(GSupplicantInterface *interface,
GSupplicantNetwork *network;
struct g_supplicant_bss *bss;
const char *path;
+#if defined TIZEN_EXT
+ char bssid_buff1[WIFI_BSSID_STR_LEN] = {0,};
+ char bssid_buff2[WIFI_BSSID_STR_LEN] = {0,};
+ char *bssid_str1 = bssid_buff1;
+ char *bssid_str2 = bssid_buff2;
+ gboolean update = FALSE;
+#endif
dbus_message_iter_get_basic(iter, &path);
if (g_strcmp0(path, "/") == 0) {
@@ -3566,7 +3599,16 @@ static void interface_current_bss(GSupplicantInterface *interface,
interface->current_network = network;
#if defined TIZEN_EXT
- SUPPLICANT_DBG("current network [%p]", interface->current_network);
+ snprintf(bssid_str1, WIFI_BSSID_STR_LEN, MACSTR, MAC2STR(bss->bssid));
+ snprintf(bssid_str2, WIFI_BSSID_STR_LEN, MACSTR, MAC2STR(network->best_bss->bssid));
+
+ SUPPLICANT_DBG("current network [%p], Passed bss %s, best bss %s",
+ interface->current_network, bssid_str1, bssid_str2);
+
+ if (network->frequency != bss->frequency) {
+ network->frequency = bss->frequency;
+ update = TRUE;
+ }
#endif
if (bss != network->best_bss) {
@@ -3579,24 +3621,25 @@ static void interface_current_bss(GSupplicantInterface *interface,
network->best_bss = bss;
-#if defined TIZEN_EXT
- if (network->frequency != bss->frequency)
- network->frequency = bss->frequency;
-#endif
-
if (network->signal != bss->signal) {
SUPPLICANT_DBG("New network signal %d dBm",
bss->signal);
network->signal = bss->signal;
callback_network_changed(network, "Signal");
- }
#if defined TIZEN_EXT
- else
- callback_network_changed(network, "");
+ update = FALSE;
+ } else {
+ update = TRUE;
#endif
+ }
}
+#if defined TIZEN_EXT
+ if (update)
+ callback_network_changed(network, "");
+#endif
+
/*
* wpa_s could notify about CurrentBSS in any state once
* it got associated. It is not sure such notification will