summaryrefslogtreecommitdiff
path: root/include/decoder.h
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2017-06-04 10:00:57 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2017-06-04 10:00:57 +0200
commita484b095fb03313f5f192b23c90d04972ca3b957 (patch)
tree3f965869157a7901bc9c92e0dc0727e9ef8d5552 /include/decoder.h
parent0bc2a81c0aab3c89b534415d6f07d07e392260ce (diff)
downloadradio-controller-a484b095fb03313f5f192b23c90d04972ca3b957.tar.gz
radio-controller-a484b095fb03313f5f192b23c90d04972ca3b957.tar.bz2
radio-controller-a484b095fb03313f5f192b23c90d04972ca3b957.tar.xz
radio-controller-a484b095fb03313f5f192b23c90d04972ca3b957.zip
o Getting closer to a working decoder.
Diffstat (limited to 'include/decoder.h')
-rw-r--r--include/decoder.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/decoder.h b/include/decoder.h
new file mode 100644
index 0000000..2a8c58e
--- /dev/null
+++ b/include/decoder.h
@@ -0,0 +1,26 @@
+#pragma once
+
+namespace radio_controller {
+
+template<typename T>
+class iterator {
+public:
+ virtual bool next() = 0;
+
+ virtual bool has_next() const = 0;
+
+ virtual const T &value() const = 0;
+};
+
+struct sample {
+ uint16_t period_us;
+ uint16_t pulse_us;
+};
+
+//template<typename T>
+class decoder {
+public:
+ virtual void decode(iterator<sample> *it) = 0;
+};
+
+} // namespace radio_controller