diff --git a/IR_Decoder.h b/IR_Decoder.h index d9d4e98..62e1bda 100644 --- a/IR_Decoder.h +++ b/IR_Decoder.h @@ -17,6 +17,7 @@ public: 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_DecoderRaw(isrPin, addr, encPair) {} @@ -26,6 +27,7 @@ public: #ifdef IRDEBUG_INFO Serial.println("PARSING RAW DATA"); #endif + gotRaw.set(&packInfo, id); isWaitingAcceptSend = false; switch (packInfo.buffer[0] >> 5 & IR_MASK_MSG_TYPE) { case IR_MSG_DATA_ACCEPT: diff --git a/IR_DecoderRaw.h b/IR_DecoderRaw.h index f9be419..a88b6bc 100644 --- a/IR_DecoderRaw.h +++ b/IR_DecoderRaw.h @@ -28,6 +28,7 @@ class IR_DecoderRaw : virtual public IR_FOX { protected: PackInfo packInfo; IR_Encoder* encoder; // Указатель на парный передатчик + bool availableRaw() { if (isAvailable) { isAvailable = false; return true; } else { return false; } }; public: const uint8_t isrPin; // Пин прерывания @@ -40,7 +41,7 @@ public: void isr(); // Функция прерывания void tick(); // Обработка приёмника, необходима для работы - bool availableRaw() { if (isAvailable) { isAvailable = false; return true; } else { return false; } }; + bool isOverflow() { return isBufferOverflow; }; // Буффер переполнился bool isReciving() { return isBufferOverflow; }; // Возвращает true, если происходит приём пакета diff --git a/PacketTypes.h b/PacketTypes.h index 1be5101..c2fe54a 100644 --- a/PacketTypes.h +++ b/PacketTypes.h @@ -18,7 +18,7 @@ namespace PacketTypes { IR_FOX::PackInfo* packInfo; uint16_t id; - virtual bool checkAddress(); + virtual bool checkAddress(){return true;}; void set(IR_FOX::PackInfo* packInfo, uint16_t id) { this->packInfo = packInfo; this->id = id;