diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2017-06-04 22:14:04 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2017-06-04 22:14:04 +0200 |
commit | 4ee01dab6105e346b731a13321a3e6a5d111d3e4 (patch) | |
tree | c5e3b6293a16f83f32f348705e946536a1b955d1 /include/samsung_decoder.h | |
parent | e758988579c3bf058214bf6e4ae56cf27b52bcfb (diff) | |
download | radio-controller-4ee01dab6105e346b731a13321a3e6a5d111d3e4.tar.gz radio-controller-4ee01dab6105e346b731a13321a3e6a5d111d3e4.tar.bz2 radio-controller-4ee01dab6105e346b731a13321a3e6a5d111d3e4.tar.xz radio-controller-4ee01dab6105e346b731a13321a3e6a5d111d3e4.zip |
o Trying for a more generic decoder structure, should be able to be dynamically programmed later on.
o Adding decoder for NEC.
Diffstat (limited to 'include/samsung_decoder.h')
-rw-r--r-- | include/samsung_decoder.h | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/include/samsung_decoder.h b/include/samsung_decoder.h index 52978ec..3e55a94 100644 --- a/include/samsung_decoder.h +++ b/include/samsung_decoder.h @@ -57,35 +57,36 @@ public: decoding_result decode(sample_iterator *it) override { - printf("Samsung, size=%d\n", it->size()); - - dump_values(it); - it->reset(); - - sample s{}; - bit_string data; - - if (!it->next()) { - return {decoding_state::TOO_SHORT}; - } - s = it->value(); - if (!start_bit(s)) { - return {decoding_state::BAD_START}; - } - - for (int i = 0; i < 32 && it->next(); i++) { - s = it->value(); - - if (one_bit(s)) { - data.append(true); - } else if (zero_bit(s)) { - data.append(false); - } else { - return {decoding_state::SHORT_BODY}; - } - } - - return {decoding_state::OK, data}; + return decoding_result{decoding_state::FAIL}; +// printf("Samsung, size=%d\n", it->size()); +// +// dump_values(it); +// it->reset(); +// +// sample s{}; +// bit_string data; +// +// if (!it->next()) { +// return {decoding_state::TOO_SHORT}; +// } +// s = it->value(); +// if (!start_bit(s)) { +// return {decoding_state::BAD_START}; +// } +// +// for (int i = 0; i < 32 && it->next(); i++) { +// s = it->value(); +// +// if (one_bit(s)) { +// data.append(true); +// } else if (zero_bit(s)) { +// data.append(false); +// } else { +// return {decoding_state::SHORT_BODY}; +// } +// } +// +// return {decoding_state::OK, data}; } }; |