return g_string_free(bssid_str, FALSE);
}
+#if defined TIZEN_EXT_INS
static void count_assoc_reject(gpointer data, gpointer user_data)
{
time_t assoc_reject_time = GPOINTER_TO_INT(data);
return assoc_count.assoc_count;
}
-#if defined TIZEN_EXT_INS
static int calculate_score_last_connected_bssid(bool is_last_connected)
{
int score = 0;
{
int score = 0;
-#if defined TIZEN_EXT_INS
score += calculate_score_last_connected_bssid(is_last_connected);
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);
-#endif
return score;
}
bssids->frequency = bss->frequency;
+#if defined TIZEN_EXT_INS
bssids->assoc_reject_cnt = get_assoc_reject_cnt(bssid_data->assoc_reject_table, bssids->bssid);
-
bssids->is_last_connected = compare_bssid(bssids->bssid, bssid_data->last_connected_bssid);
-#if defined TIZEN_EXT_INS
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_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,
bss->snr, bss->est_throughput);
-
+#else
+ bssids->ins_score = bss->signal;
+#endif
bssid_data->bssid_list = g_slist_append(bssid_data->bssid_list, bssids);
} else
SUPPLICANT_DBG("Failed to allocate memory");
return true;
}
+#if defined TIZEN_EXT_INS
score_new = calculate_score(
compare_bssid(bss->bssid, network->last_connected_bssid),
get_assoc_reject_cnt(network->assoc_reject_table, bss->bssid),
get_assoc_reject_cnt(network->assoc_reject_table, network->best_bss->bssid),
network->best_bss->frequency, network->best_bss->signal,
network->best_bss->snr, network->best_bss->est_throughput);
+#else
+ score_new = bss->signal;
+ score_best = network->best_bss->signal;
+#endif
if (score_new > score_best) {
SUPPLICANT_DBG("new[" MACSTR "][%u] : best[" MACSTR "][%u]",
if (bssid == NULL)
return -EINVAL;
-#if defined TIZEN_EXT
+
if (!simplified_log)
-#endif
- DBG("network %p bssid %02x:%02x:%02x:%02x:%02x:%02x", network,
- bssid[0], bssid[1], bssid[2],
- bssid[3], bssid[4], bssid[5]);
+ DBG("network %p bssid %02x:%02x:%02x:%02x:%02x:%02x", network,
+ bssid[0], bssid[1], bssid[2],
+ bssid[3], bssid[4], bssid[5]);
for (;i < WIFI_BSSID_LEN_MAX;i++)
network->wifi.bssid[i] = bssid[i];
if (encryption_mode == NULL)
return -EINVAL;
-#if defined TIZEN_EXT
if (!simplified_log)
-#endif
- DBG("network %p encryption mode %s", network, encryption_mode);
+ DBG("network %p encryption mode %s", network, encryption_mode);
g_strlcpy(network->wifi.encryption_mode, encryption_mode,
WIFI_ENCYPTION_MODE_LEN_MAX);
if (country_code == NULL)
return -EINVAL;
-#if defined TIZEN_EXT
if (!simplified_log)
-#endif
- DBG("network %p Country Code %02x:%02x",network,
- country_code[0],country_code[1]);
+ DBG("network %p Country Code %02x:%02x",network,
+ country_code[0],country_code[1]);
for (; i < WIFI_COUNTRY_CODE_LEN; i++)
network->wifi.country_code[i] = country_code[i];
int connman_network_set_phy_mode(struct connman_network *network,
ieee80211_modes_e mode)
{
-#if defined TIZEN_EXT
if (!simplified_log)
-#endif
- DBG("network %p phy mode %d", network, mode);
+ DBG("network %p phy mode %d", network, mode);
network->wifi.phy_mode = mode;
return 0;
int i;
int err = 0;
-#if defined TIZEN_EXT
if (!simplified_log)
-#endif
- DBG("service %p", service);
+ DBG("service %p", service);
if (!service->network)
return -EINVAL;
#endif
}
-#if defined TIZEN_EXT && defined TIZEN_EXT_INS
+#if defined TIZEN_EXT
static void connect_reason_changed(struct connman_service *service)
{
+#if defined TIZEN_EXT_INS
struct connman_device *device;
-
+#endif
if (!service->path)
return;
if (!allow_property_changed(service))
return;
+#if defined TIZEN_EXT_INS
if (service->connect_reason == CONNMAN_SERVICE_CONNECT_REASON_USER) {
device = connman_network_get_device(service->network);
if (device) {
connman_device_save_last_user_selection(device);
}
}
+#endif
connman_dbus_property_changed_basic(service->path,
- CONNMAN_SERVICE_INTERFACE,
- "ConnectReason",
- DBUS_TYPE_INT32,
- &service->connect_reason);
+ CONNMAN_SERVICE_INTERFACE,
+ "ConnectReason",
+ DBUS_TYPE_INT32,
+ &service->connect_reason);
}
#endif /* defined TIZEN_EXT && defined TIZEN_EXT_INS */
DBG("service %p err %d", service, err);
service->connect_reason = reason;
-#if defined TIZEN_EXT && defined TIZEN_EXT_INS
+#if defined TIZEN_EXT
connect_reason_changed(service);
-#endif /* defined TIZEN_EXT && defined TIZEN_EXT_INS */
+#endif
if (err >= 0)
return 0;