summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-03-06 11:34:27 +0100
committerHarald Welte <laforge@gnumonks.org>2010-03-06 11:34:27 +0100
commit63d3e396e79bae0e3580a8813a8c1c0166a51b59 (patch)
tree4315ae6c61b4162e4f00538f9e12f51561ac7c9b /include
parent380ae25052e5b09922d9a3642ad8743a22330f86 (diff)
introduce RxLev statistics module, an efficient way for power scan data
Diffstat (limited to 'include')
-rw-r--r--include/osmocore/Makefile.am2
-rw-r--r--include/osmocore/rxlev_stat.h22
2 files changed, 23 insertions, 1 deletions
diff --git a/include/osmocore/Makefile.am b/include/osmocore/Makefile.am
index b45d0233..9c4fc757 100644
--- a/include/osmocore/Makefile.am
+++ b/include/osmocore/Makefile.am
@@ -1,6 +1,6 @@
osmocore_HEADERS = signal.h linuxlist.h timer.h talloc.h msgb.h select.h \
tlv.h bitvec.h comp128.h statistics.h gsm_utils.h utils.h \
- gsmtap.h write_queue.h rsl.h gsm48.h
+ gsmtap.h write_queue.h rsl.h gsm48.h rxlev_stat.h
osmocoredir = $(includedir)/osmocore
diff --git a/include/osmocore/rxlev_stat.h b/include/osmocore/rxlev_stat.h
new file mode 100644
index 00000000..415509dc
--- /dev/null
+++ b/include/osmocore/rxlev_stat.h
@@ -0,0 +1,22 @@
+#ifndef _OSMOCORE_RXLEV_STATS_H
+#define _OSMOCORE_RXLEV_STATS_H
+
+#define NUM_RXLEVS 32
+#define NUM_ARFCNS 1024
+
+struct rxlev_stats {
+ /* the maximum number of ARFCN's is 1024, and there are 32 RxLevels,
+ * so in we keep one 1024bit-bitvec for each RxLev */
+ uint8_t rxlev_buckets[NUM_RXLEVS][NUM_ARFCNS/8];
+};
+
+void rxlev_stat_input(struct rxlev_stats *st, uint16_t arfcn, uint8_t rxlev);
+
+/* get the next ARFCN that has the specified Rxlev */
+int16_t rxlev_stat_get_next(const struct rxlev_stats *st, uint8_t rxlev, int16_t arfcn);
+
+void rxlev_stat_reset(struct rxlev_stats *st);
+
+void rxlev_stat_dump(const struct rxlev_stats *st);
+
+#endif /* _OSMOCORE_RXLEV_STATS_H */