mirror of
https://github.com/Show-maket/IR-protocol.git
synced 2025-06-28 05:09:40 +00:00
refactor
This commit is contained in:
64
IR_Decoder.h
64
IR_Decoder.h
@ -1,33 +1,45 @@
|
||||
#pragma once
|
||||
#include "IR_config.h"
|
||||
|
||||
// class IR_Decoder
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#include "IR_DecoderRaw.h"
|
||||
#include "PacketTypes.h"
|
||||
|
||||
class IR_Decoder : public IR_DecoderRaw {
|
||||
public:
|
||||
IR_Decoder(const uint8_t isrPin, uint16_t addr, IR_Encoder* encPair = nullptr) :
|
||||
IR_DecoderRaw(isrPin, addr, encPair),
|
||||
gotData(Data(&packInfo)) {
|
||||
}
|
||||
|
||||
Data gotData;
|
||||
|
||||
void tick() {
|
||||
IR_DecoderRaw::tick();
|
||||
if (available()) {
|
||||
Serial.println("PARSING RAW DATA");
|
||||
|
||||
switch (packInfo.buffer[0] & IR_MASK_MSG_TYPE) {
|
||||
case IR_MSG_DATA_NOACCEPT:
|
||||
|
||||
break;
|
||||
case IR_MSG_DATA_ACCEPT:
|
||||
break;
|
||||
case IR_MSG_BACK:
|
||||
break;
|
||||
case IR_MSG_BACK_TO:
|
||||
break;
|
||||
case IR_MSG_REQUEST:
|
||||
break;
|
||||
case IR_MSG_ACCEPT:
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user