From f0f5534c827020ff942e76ce594ee332b5255f5f Mon Sep 17 00:00:00 2001 From: PolynomialDivision Date: Mon, 18 Sep 2017 17:35:26 +0200 Subject: [PATCH] Add channel utilization --- src/include/datastorage.h | 4 ++-- src/utils/dawn_uci.c | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/include/datastorage.h b/src/include/datastorage.h index e2355ea..f5221f1 100644 --- a/src/include/datastorage.h +++ b/src/include/datastorage.h @@ -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; }; diff --git a/src/utils/dawn_uci.c b/src/utils/dawn_uci.c index ef92af8..1127a12 100644 --- a/src/utils/dawn_uci.c +++ b/src/utils/dawn_uci.c @@ -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;