Add channel utilization

This commit is contained in:
PolynomialDivision 2017-09-18 17:35:26 +02:00
parent 8a3216f942
commit f0f5534c82
2 changed files with 27 additions and 2 deletions

View file

@ -18,8 +18,8 @@ struct probe_metric_s dawn_metric;
struct probe_metric_s {
int ht_support;
int vht_support;
int n_ht_support;
int n_vht_support;
int no_ht_support;
int no_vht_support;
int rssi;
int freq;
};

View file

@ -38,6 +38,22 @@ struct probe_metric_s uci_get_dawn_metric()
if(ptr.o->type == UCI_TYPE_STRING)
ret.vht_support = atoi(ptr.o->v.string);
char tmp_no_ht_support[] = "dawn.metric.no_ht_support";
if (uci_lookup_ptr (c, &ptr, tmp_no_ht_support, 1) != UCI_OK) {
uci_perror(c, "uci_get_daw_metric Error");
return ret;
}
if(ptr.o->type == UCI_TYPE_STRING)
ret.no_ht_support = atoi(ptr.o->v.string);
char tmp_no_vht_support[] = "dawn.metric.no_vht_support";
if (uci_lookup_ptr (c, &ptr, tmp_vht_support, 1) != UCI_OK) {
uci_perror(c, "uci_get_daw_metric Error");
return ret;
}
if(ptr.o->type == UCI_TYPE_STRING)
ret.no_vht_support = atoi(ptr.o->v.string);
char tmp_rssi[] = "dawn.metric.freq";
if (uci_lookup_ptr (c, &ptr, tmp_rssi, 1) != UCI_OK) {
uci_perror(c, "uci_get_daw_metric Error");
@ -54,6 +70,15 @@ struct probe_metric_s uci_get_dawn_metric()
if(ptr.o->type == UCI_TYPE_STRING)
ret.freq = atoi(ptr.o->v.string);
char tmp_freq[] = "dawn.metric.chan_util";
if (uci_lookup_ptr (c, &ptr, tmp_freq, 1) != UCI_OK) {
uci_perror(c, "uci_get_daw_metric Error");
return ret;
}
if(ptr.o->type == UCI_TYPE_STRING)
ret.freq = atoi(ptr.o->v.string);
uci_free_context (c);
return ret;