2021-05-04 13:21:16 +00:00
|
|
|
#pragma once
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <limits.h>
|
|
|
|
#include <atomic>
|
2021-08-01 22:11:18 +00:00
|
|
|
#include "protocols/protocol-indala-40134.h"
|
2021-05-04 13:21:16 +00:00
|
|
|
|
|
|
|
class DecoderIndala {
|
|
|
|
public:
|
|
|
|
bool read(uint8_t* data, uint8_t data_size);
|
|
|
|
void process_front(bool polarity, uint32_t time);
|
|
|
|
|
2021-08-01 22:11:18 +00:00
|
|
|
void process_internal(bool polarity, uint32_t time, uint64_t* data);
|
|
|
|
|
2021-05-04 13:21:16 +00:00
|
|
|
DecoderIndala();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void reset_state();
|
|
|
|
|
2021-08-01 22:11:18 +00:00
|
|
|
uint64_t raw_data;
|
|
|
|
uint64_t cursed_raw_data;
|
2021-05-04 13:21:16 +00:00
|
|
|
|
|
|
|
std::atomic<bool> ready;
|
2021-08-01 22:11:18 +00:00
|
|
|
std::atomic<bool> cursed_data_valid;
|
|
|
|
ProtocolIndala40134 indala;
|
2021-05-04 13:21:16 +00:00
|
|
|
};
|