summaryrefslogtreecommitdiff
path: root/include/samsung_decoder.h
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2017-06-04 17:33:51 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2017-06-04 17:33:51 +0200
commitd30e3fa68d7192da22c1569f56f564b92896170d (patch)
treefdbfbe53a9c9cb6f5136af53e17f831b069337a2 /include/samsung_decoder.h
parenta484b095fb03313f5f192b23c90d04972ca3b957 (diff)
downloadradio-controller-d30e3fa68d7192da22c1569f56f564b92896170d.tar.gz
radio-controller-d30e3fa68d7192da22c1569f56f564b92896170d.tar.bz2
radio-controller-d30e3fa68d7192da22c1569f56f564b92896170d.tar.xz
radio-controller-d30e3fa68d7192da22c1569f56f564b92896170d.zip
o Working decoder for Samsung remotes.
Diffstat (limited to 'include/samsung_decoder.h')
-rw-r--r--include/samsung_decoder.h38
1 files changed, 0 insertions, 38 deletions
diff --git a/include/samsung_decoder.h b/include/samsung_decoder.h
deleted file mode 100644
index 5d2b555..0000000
--- a/include/samsung_decoder.h
+++ /dev/null
@@ -1,38 +0,0 @@
-#pragma
-
-#include "decoder.h"
-
-namespace radio_controller {
-
-class samsung_decoder : public decoder {
-
- inline
- bool between(uint16_t smallest, uint16_t biggest, uint16_t value)
- {
- return smallest <= value && value <= biggest;
- }
-
- inline
- bool start_bit(uint16_t time)
- {
- return between(4200, 4700, time);
- }
-
- inline
- bool one_bit(uint16_t time)
- {
- return between(4200, 4700, time);
- }
-
-public:
- void decode(iterator<sample> *it) override
- {
- printf("Samsung\n");
- while (it->next()) {
- auto s = it->value();
- printf("% 5d us % 5d us, %.02d%%\n", s.period_us, s.pulse_us, int(s.pulse_us / double(s.period_us) * 100));
- }
- }
-};
-
-} // namespace radio_controller