mirror of
https://github.com/Show-maket/IR-protocol.git
synced 2025-05-04 07:10:16 +00:00
41 lines
919 B
C++
41 lines
919 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 isrPin, 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;
|
|
}
|
|
};
|