summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehyun Kim <jeik01.kim@samsung.com>2021-12-07 07:39:34 +0000
committerGerrit Code Review <gerrit@review>2021-12-07 07:39:34 +0000
commit4c163d3e732cc2bf4042cd9dbcb775ce825b96f6 (patch)
tree38fed8c38883b75a9935af3d68b2e2ded114579f
parentea037b245b808e58381a7a1eddf2f33b8b7e83ca (diff)
parent7d0b729a491d0ee388cf3d0a73b87cd2f506c314 (diff)
downloadconnman-4c163d3e732cc2bf4042cd9dbcb775ce825b96f6.tar.gz
connman-4c163d3e732cc2bf4042cd9dbcb775ce825b96f6.tar.bz2
connman-4c163d3e732cc2bf4042cd9dbcb775ce825b96f6.zip
Merge "Fix an incorrect value being used for signal score calculation" into tizen
-rwxr-xr-xgsupplicant/supplicant.c2
-rwxr-xr-xsrc/service.c11
2 files changed, 9 insertions, 4 deletions
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 427c8ca8..fe1b21f5 100755
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -2172,7 +2172,7 @@ static void update_bssid_list(gpointer key, gpointer value, gpointer user_data)
bssids->score_last_connected_bssid = calculate_score_last_connected_bssid(bssids->is_last_connected);
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_strength = calculate_score_strength(bss->signal);
bssids->score_snr = (int)bss->snr;
bssids->score_est_throughput = calculate_score_est_throughput(bss->est_throughput);
#endif
diff --git a/src/service.c b/src/service.c
index 8ffb254b..130002fd 100755
--- a/src/service.c
+++ b/src/service.c
@@ -7958,7 +7958,7 @@ static int calculate_score_frequency(struct connman_service *service)
switch (ins_settings.preferred_freq) {
case CONNMAN_INS_PREFERRED_FREQ_24GHZ:
- if ((frequency >= FREQ_RANGE_24GHZ_CHANNEL_14 &&
+ if ((frequency >= FREQ_RANGE_24GHZ_CHANNEL_1 &&
frequency <= FREQ_RANGE_24GHZ_CHANNEL_14) &&
(service->strength >= ins_settings.signal_level3_24ghz))
score += ins_settings.preferred_freq_score;
@@ -11185,8 +11185,13 @@ static void ins_setting_init(void)
ins_settings.preferred_freq_score = connman_setting_get_uint("INSPreferredFreqScore");
ins_settings.internet_score = connman_setting_get_uint("INSInternetScore");
- ins_settings.signal_level3_5ghz = connman_setting_get_int("INSSignalLevel3_5GHz");
- ins_settings.signal_level3_24ghz = connman_setting_get_int("INSSignalLevel3_24GHz");
+ /*
+ * In ConnMan, signal strength is used after being converted
+ * to positive value(signal strength + 120).
+ * So the value for comparison should also be converted to the same.
+ */
+ ins_settings.signal_level3_5ghz = connman_setting_get_int("INSSignalLevel3_5GHz") + 120;
+ ins_settings.signal_level3_24ghz = connman_setting_get_int("INSSignalLevel3_24GHz") + 120;
DBG("last_user_selection [%s]", ins_settings.last_user_selection ? "true" : "false");
DBG("last_user_selection_time [%d]", ins_settings.last_user_selection_time);