IR-protocol/IR_Decoder.h
2024-04-24 10:34:57 +03:00

41 lines
916 B
C++

#pragma once
#include "IR_DecoderRaw.h"
#include "PacketTypes.h"
#include "IR_Encoder.h"
class IR_Decoder : public IR_DecoderRaw
{
private:
// static std::list<IR_Decoder *> dec_list;
static std::list<IR_Decoder*>& get_dec_list();
void _tick();
uint32_t acceptSendTimer;
bool isWaitingAcceptSend;
uint16_t addrAcceptSendTo;
uint16_t acceptDelay = 75;
uint8_t acceptCustomByte;
public:
PacketTypes::Data gotData;
PacketTypes::DataBack gotBackData;
PacketTypes::Accept gotAccept;
PacketTypes::Request gotRequest;
PacketTypes::BasePack gotRaw;
IR_Decoder(const uint8_t pin, uint16_t addr, IR_Encoder *encPair = nullptr);
~IR_Decoder();
static void tick();
inline void setAcceptDelay(uint16_t acceptDelay)
{
this->acceptDelay = acceptDelay;
}
inline uint16_t getAcceptDelay()
{
return this->acceptDelay;
}
};