dbus_bool_t hs20;
unsigned char country_code[COUNTRY_CODE_LENGTH];
GSupplicantPhy_mode phy_mode;
+ dbus_int16_t snr;
+ dbus_uint32_t est_throughput;
#endif
unsigned int wps_capabilities;
#if defined TIZEN_EXT
int score_assoc_reject;
int score_frequency;
int score_strength;
+ int score_snr;
+ int score_est_throughput;
#endif
int ins_score;
};
return score;
}
+static int calculate_score_est_throughput(dbus_uint32_t est_throughput)
+{
+ int score = 0;
+
+ if (est_throughput >= 10000)
+ score = est_throughput / 10000;
+
+ if (score > 40)
+ score = 40;
+
+ return score;
+}
+
static int calculate_score(bool is_last_connected, uint16_t assoc_reject_cnt,
- dbus_int16_t strength, dbus_uint16_t frequency)
+ dbus_uint16_t frequency, dbus_int16_t strength,
+ dbus_int16_t snr, dbus_uint32_t est_throughput)
{
int score = 0;
score += calculate_score_assoc_reject(assoc_reject_cnt);
score += calculate_score_frequency(strength, frequency);
score += calculate_score_strength(strength);
+ score += (int)snr;
+ score += calculate_score_est_throughput(est_throughput);
return score;
}
bssids->score_assoc_reject = calculate_score_assoc_reject(bssids->assoc_reject_cnt);
bssids->score_frequency = calculate_score_frequency(bss->signal, bssids->frequency);
bssids->score_strength = calculate_score_strength(bssids->strength);
+ bssids->score_snr = (int)bss->snr;
+ bssids->score_est_throughput = calculate_score_est_throughput(bss->est_throughput);
#endif
bssids->ins_score = calculate_score(bssids->is_last_connected,
- bssids->assoc_reject_cnt, bssids->frequency, bss->signal);
+ bssids->assoc_reject_cnt, bssids->frequency, bss->signal,
+ bss->snr, bss->est_throughput);
bssid_data->bssid_list = g_slist_append(bssid_data->bssid_list, bssids);
} else
score_new = calculate_score(
compare_bssid(bss->bssid, network->last_connected_bssid),
get_assoc_reject_cnt(network->assoc_reject_table, bss->bssid),
- bss->frequency, bss->signal);
+ bss->frequency, bss->signal, bss->snr, bss->est_throughput);
score_best = calculate_score(
compare_bssid(network->best_bss->bssid, network->last_connected_bssid),
get_assoc_reject_cnt(network->assoc_reject_table, network->best_bss->bssid),
- network->best_bss->frequency, network->best_bss->signal);
+ network->best_bss->frequency, network->best_bss->signal,
+ network->best_bss->snr, network->best_bss->est_throughput);
if (score_new > score_best) {
SUPPLICANT_DBG("new[" MACSTR "][%u] : best[" MACSTR "][%u]",
dbus_bool_t hs20 = FALSE;
dbus_message_iter_get_basic(iter, &hs20);
bss->hs20 = hs20;
+ } else if (g_strcmp0(key, "SNR") == 0) {
+ dbus_int16_t snr = 0;
+
+ dbus_message_iter_get_basic(iter, &snr);
+ bss->snr = snr;
+ } else if (g_strcmp0(key, "EstThroughput") == 0) {
+ dbus_uint32_t est_throughput = 0;
+
+ dbus_message_iter_get_basic(iter, &est_throughput);
+ if (est_throughput != 0)
+ bss->est_throughput = est_throughput;
#endif
} else if (g_strcmp0(key, "IEs") == 0)
bss_process_ies(iter, bss);
interface_add_network_result, data,
interface);
}
- }
+ }
if (ret < 0) {
g_free(data->path);