mirror of
https://github.com/berlin-open-wireless-lab/DAWN.git
synced 2025-03-09 15:40:12 +00:00
Make probecounter part of the metric
This commit is contained in:
parent
b00123f19f
commit
81ecf9d161
4 changed files with 13 additions and 3 deletions
|
@ -19,4 +19,5 @@ config settings metric
|
|||
option freq '50'
|
||||
option chan_util '0'
|
||||
option max_chan_util '100'
|
||||
option min_rssi '-60'
|
||||
option min_rssi '-60'
|
||||
option min_probe_count '5'
|
|
@ -25,6 +25,7 @@ struct probe_metric_s {
|
|||
int chan_util;
|
||||
int max_chan_util;
|
||||
int min_rssi;
|
||||
int min_probe_count;
|
||||
};
|
||||
|
||||
#define SORT_NUM 5
|
||||
|
|
|
@ -94,7 +94,15 @@ struct probe_metric_s uci_get_dawn_metric()
|
|||
if(ptr.o->type == UCI_TYPE_STRING)
|
||||
ret.max_chan_util = atoi(ptr.o->v.string);
|
||||
|
||||
printf("Loaded metric: %d, %d\n", ret.min_rssi, ret.max_chan_util);
|
||||
char tmp_min_probe_count[] = "dawn.min_probe_count";
|
||||
if (uci_lookup_ptr (c, &ptr, tmp_min_probe_count, 1) != UCI_OK) {
|
||||
uci_perror(c, "uci_get_daw_metric Error");
|
||||
return ret;
|
||||
}
|
||||
if(ptr.o->type == UCI_TYPE_STRING)
|
||||
ret.min_probe_count = atoi(ptr.o->v.string);
|
||||
|
||||
printf("Loaded metric: %d\n", ret.min_probe_count);
|
||||
|
||||
uci_free_context (c);
|
||||
|
||||
|
|
|
@ -136,7 +136,7 @@ static int decide_function(probe_entry *prob_req) {
|
|||
// TODO: Refactor...
|
||||
//printf("COUNTER: %d\n", prob_req->counter);
|
||||
|
||||
if (prob_req->counter < MIN_PROBE_REQ) {
|
||||
if (prob_req->counter < dawn_metric.min_probe_count) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue