add ability of station count to config file

This commit is contained in:
PolynomialDivision 2017-12-15 23:18:28 +01:00
parent e2a16404b1
commit 3b6f6e1fc4
4 changed files with 37 additions and 27 deletions

View file

@ -1,36 +1,37 @@
config settings network
option broadcast_ip '225.0.0.37'
option broadcast_port '1025'
option multicast '1'
option shared_key 'Niiiiiiiiiiiiiik'
option iv 'Niiiiiiiiiiiiiik'
option broadcast_ip '225.0.0.37'
option broadcast_port '1025'
option multicast '1'
option shared_key 'Niiiiiiiiiiiiiik'
option iv 'Niiiiiiiiiiiiiik'
config settings ordering
option sort_order 'csfb'
config settings hostapd
option hostapd_dir '/var/run/hostapd'
option hostapd_dir '/var/run/hostapd'
config settings times
option update_client '50'
option remove_client '120'
option remove_probe '120'
option remove_ap '460'
option update_hostapd '10'
option update_client '10'
option remove_client '120'
option remove_probe '120'
option remove_ap '460'
option update_hostapd '10'
config settings metric
option ht_support '10'
option vht_support '50'
option no_ht_support '0'
option no_vht_support '0'
option rssi '10'
option low_rssi '-500'
option freq '100'
option chan_util '50'
option max_chan_util '-50'
option rssi_val '-60'
option low_rssi_val '-80'
option chan_util_val '140'
option max_chan_util_val '170'
option min_probe_count '2'
option bandwith_threshold '6'
option ht_support '10'
option vht_support '10'
option no_ht_support '0'
option no_vht_support '0'
option rssi '10'
option low_rssi '-500'
option freq '100'
option chan_util '50'
option max_chan_util '-50'
option rssi_val '-60'
option low_rssi_val '-80'
option chan_util_val '140'
option max_chan_util_val '170'
option min_probe_count '4'
option bandwith_threshold '6'
option use_station_count '1'

View file

@ -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 {

View file

@ -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...

View file

@ -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);