diff --git a/src/include/datastorage.h b/src/include/datastorage.h index 86c1e73..6d7a6fd 100644 --- a/src/include/datastorage.h +++ b/src/include/datastorage.h @@ -33,6 +33,7 @@ struct probe_metric_s { int max_chan_util_val; int min_probe_count; int bandwith_threshold; + int use_station_count; }; struct time_config_s { diff --git a/src/storage/datastorage.c b/src/storage/datastorage.c index 458a3e3..a07eae8 100644 --- a/src/storage/datastorage.c +++ b/src/storage/datastorage.c @@ -154,7 +154,7 @@ int better_ap_available(uint8_t bssid_addr[], uint8_t client_addr[], int automat { return 1; } - if (!mac_is_equal(bssid_addr, probe_array[k].bssid_addr) && + if ( dawn_metric.use_station_count && !mac_is_equal(bssid_addr, probe_array[k].bssid_addr) && own_score == eval_probe_metric(probe_array[k])) { // if ap have same value but station count is different... diff --git a/src/utils/dawn_uci.c b/src/utils/dawn_uci.c index 9ca9938..05401a6 100644 --- a/src/utils/dawn_uci.c +++ b/src/utils/dawn_uci.c @@ -209,6 +209,14 @@ struct probe_metric_s uci_get_dawn_metric() { if (ptr.o->type == UCI_TYPE_STRING) ret.bandwith_threshold = atoi(ptr.o->v.string); + char tmp_use_station_count[] = "dawn.metric.use_station_count"; + if (uci_lookup_ptr(c, &ptr, tmp_use_station_count, 1) != UCI_OK) { + uci_perror(c, "uci_get_daw_metric Error"); + return ret; + } + if (ptr.o->type == UCI_TYPE_STRING) + ret.use_station_count = atoi(ptr.o->v.string); + printf("Loaded metric: %d\n", ret.min_probe_count); uci_free_context(c);