mirror of
				https://github.com/Show-maket/IR-protocol.git
				synced 2025-10-29 01:52:35 +00:00 
			
		
		
		
	add Raw
This commit is contained in:
		| @ -17,6 +17,7 @@ public: | |||||||
|     PacketTypes::DataBack gotBackData; |     PacketTypes::DataBack gotBackData; | ||||||
|     PacketTypes::Accept gotAccept; |     PacketTypes::Accept gotAccept; | ||||||
|     PacketTypes::Request gotRequest; |     PacketTypes::Request gotRequest; | ||||||
|  |     PacketTypes::BasePack gotRaw; | ||||||
|  |  | ||||||
|     IR_Decoder(const uint8_t isrPin, uint16_t addr, IR_Encoder* encPair = nullptr) : IR_DecoderRaw(isrPin, addr, encPair) {} |     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 |             #ifdef IRDEBUG_INFO | ||||||
|             Serial.println("PARSING RAW DATA"); |             Serial.println("PARSING RAW DATA"); | ||||||
|             #endif |             #endif | ||||||
|  |             gotRaw.set(&packInfo, id); | ||||||
|             isWaitingAcceptSend = false; |             isWaitingAcceptSend = false; | ||||||
|             switch (packInfo.buffer[0] >> 5 & IR_MASK_MSG_TYPE) { |             switch (packInfo.buffer[0] >> 5 & IR_MASK_MSG_TYPE) { | ||||||
|                 case IR_MSG_DATA_ACCEPT: |                 case IR_MSG_DATA_ACCEPT: | ||||||
|  | |||||||
| @ -28,6 +28,7 @@ class IR_DecoderRaw : virtual public IR_FOX { | |||||||
| protected: | protected: | ||||||
|     PackInfo packInfo; |     PackInfo packInfo; | ||||||
|     IR_Encoder* encoder;                    // Указатель на парный передатчик |     IR_Encoder* encoder;                    // Указатель на парный передатчик | ||||||
|  |     bool availableRaw() { if (isAvailable) { isAvailable = false; return true; } else { return false; } }; | ||||||
| public: | public: | ||||||
|     const uint8_t isrPin;   // Пин прерывания  |     const uint8_t isrPin;   // Пин прерывания  | ||||||
|  |  | ||||||
| @ -40,7 +41,7 @@ public: | |||||||
|  |  | ||||||
|     void isr();     // Функция прерывания |     void isr();     // Функция прерывания | ||||||
|     void tick();    // Обработка приёмника, необходима для работы |     void tick();    // Обработка приёмника, необходима для работы | ||||||
|     bool availableRaw() { if (isAvailable) { isAvailable = false; return true; } else { return false; } }; |      | ||||||
|     bool isOverflow() { return isBufferOverflow; }; // Буффер переполнился  |     bool isOverflow() { return isBufferOverflow; }; // Буффер переполнился  | ||||||
|     bool isReciving() { return isBufferOverflow; }; // Возвращает true, если происходит приём пакета |     bool isReciving() { return isBufferOverflow; }; // Возвращает true, если происходит приём пакета | ||||||
|  |  | ||||||
|  | |||||||
| @ -18,7 +18,7 @@ namespace PacketTypes { | |||||||
|         IR_FOX::PackInfo* packInfo; |         IR_FOX::PackInfo* packInfo; | ||||||
|         uint16_t id; |         uint16_t id; | ||||||
|  |  | ||||||
|         virtual bool checkAddress(); |         virtual bool checkAddress(){return true;}; | ||||||
|         void set(IR_FOX::PackInfo* packInfo, uint16_t id) { |         void set(IR_FOX::PackInfo* packInfo, uint16_t id) { | ||||||
|             this->packInfo = packInfo; |             this->packInfo = packInfo; | ||||||
|             this->id = id; |             this->id = id; | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user