You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
904 B
C++

// CommandEncoder.h
#ifndef _COMMANDENCODER_h
#define _COMMANDENCODER_h
#if defined(ARDUINO) && ARDUINO >= 100
#include "arduino.h"
#else
#include "WProgram.h"
#endif
#include "GlobalDatas.h"
class CommandEncoder
{
private:
byte cmd[8];
byte ir_cmd[6];
private:
byte CheckSUM(byte main, byte data1, byte data2, byte data3);
public:
CommandEncoder();
CommandEncoder(const CommandEncoder& obj) = delete;
CommandEncoder(byte ir1, byte ir2, byte ir3, byte ir4, byte ir5, byte ir6);
CommandEncoder(byte device, byte main = 0x00, byte data1 = 0x00, byte data2 = 0x00, byte data3 = 0x00);
public:
void SetDevice(byte device);
void OverrideFrameHead(byte h1, byte h2);
void SetCommand(byte ir1, byte ir2, byte ir3, byte ir4, byte ir5, byte ir6);
void SetCommand(byte main, byte data1 = 0x00, byte data2 = 0x00, byte data3 = 0x00);
byte* GetCommandArray();
byte* GetIRCommandArray();
};
#endif