add max chan utilization

This commit is contained in:
PolynomialDivision 2017-12-12 16:39:39 +01:00
parent bbb98af69c
commit 991b575fea
4 changed files with 24 additions and 2 deletions

View file

@ -27,8 +27,10 @@ config settings metric
option low_rssi '-500'
option freq '100'
option chan_util '50'
option max_chan_util '150'
option max_chan_util '-50'
option rssi_val '-60'
option low_rssi_val '-80'
option chan_util_val '70'
option max_chan_util_val '150'
option min_probe_count '2'
option bandwith_threshold '6'

View file

@ -29,6 +29,8 @@ struct probe_metric_s {
int max_chan_util;
int rssi_val;
int low_rssi_val;
int chan_util_val;
int max_chan_util_val;
int min_probe_count;
int bandwith_threshold;
};

View file

@ -75,7 +75,8 @@ int eval_probe_metric(struct probe_entry_s probe_entry) {
score += !probe_entry.ht_support && !ap_entry.ht ? dawn_metric.no_ht_support : 0;
score += probe_entry.vht_support && ap_entry.vht ? dawn_metric.vht_support : 0;
score += !probe_entry.vht_support && !ap_entry.vht ? dawn_metric.no_vht_support : 0;
score += ap_entry.channel_utilization <= dawn_metric.max_chan_util ? dawn_metric.chan_util : 0;
score += ap_entry.channel_utilization <= dawn_metric.chan_util_val ? dawn_metric.chan_util : 0;
score += ap_entry.channel_utilization > dawn_metric.max_chan_util_val ? dawn_metric.max_chan_util : 0;
}
score += (probe_entry.freq > 5000) ? dawn_metric.freq : 0;

View file

@ -158,6 +158,23 @@ struct probe_metric_s uci_get_dawn_metric() {
if (ptr.o->type == UCI_TYPE_STRING)
ret.max_chan_util = atoi(ptr.o->v.string);
char tmp_chan_util_val[] = "dawn.metric.chan_util_val";
if (uci_lookup_ptr(c, &ptr, tmp_chan_util_val, 1) != UCI_OK) {
uci_perror(c, "uci_get_daw_metric Error");
return ret;
}
if (ptr.o->type == UCI_TYPE_STRING)
ret.chan_util_val = atoi(ptr.o->v.string);
char tmp_max_chan_util_val[] = "dawn.metric.max_chan_util_val";
if (uci_lookup_ptr(c, &ptr, tmp_max_chan_util_val, 1) != UCI_OK) {
uci_perror(c, "uci_get_daw_metric Error");
return ret;
}
if (ptr.o->type == UCI_TYPE_STRING)
ret.max_chan_util_val = atoi(ptr.o->v.string);
printf("Try to load min_probe_count\n");
char tmp_min_probe_count[] = "dawn.metric.min_probe_count";