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