mirror of
https://github.com/Show-maket/IR-protocol.git
synced 2025-05-04 07:10:16 +00:00
add simple sendData
This commit is contained in:
parent
aed1543bd3
commit
eac364b0d3
@ -33,6 +33,13 @@ IR_Encoder::~IR_Encoder() {
|
|||||||
delete [] bitHigh;
|
delete [] bitHigh;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void IR_Encoder::sendData(uint16_t addrTo, uint8_t dataByte, bool needAccept = false) {
|
||||||
|
uint8_t* dataPtr = new uint8_t[1];
|
||||||
|
dataPtr[0] = dataByte;
|
||||||
|
sendData(addrTo, dataPtr, 1, needAccept);
|
||||||
|
delete[] dataPtr;
|
||||||
|
}
|
||||||
|
|
||||||
void IR_Encoder::sendData(uint16_t addrTo, uint8_t* data = nullptr, uint8_t len = 0, bool needAccept = false) {
|
void IR_Encoder::sendData(uint16_t addrTo, uint8_t* data = nullptr, uint8_t len = 0, bool needAccept = false) {
|
||||||
if (len > bytePerPack) { return; }
|
if (len > bytePerPack) { return; }
|
||||||
constexpr uint8_t dataStart = msgBytes + addrBytes + addrBytes;
|
constexpr uint8_t dataStart = msgBytes + addrBytes + addrBytes;
|
||||||
|
@ -47,13 +47,16 @@ public:
|
|||||||
|
|
||||||
void IR_Encoder::setBlindDecoders(IR_DecoderRaw* decoders [], uint8_t count);
|
void IR_Encoder::setBlindDecoders(IR_DecoderRaw* decoders [], uint8_t count);
|
||||||
void rawSend(uint8_t* ptr, uint8_t len);
|
void rawSend(uint8_t* ptr, uint8_t len);
|
||||||
|
|
||||||
|
void sendData(uint16_t addrTo, uint8_t dataByte, bool needAccept = false);
|
||||||
void sendData(uint16_t addrTo, uint8_t* data = nullptr, uint8_t len = 0, bool needAccept = false);
|
void sendData(uint16_t addrTo, uint8_t* data = nullptr, uint8_t len = 0, bool needAccept = false);
|
||||||
|
|
||||||
void sendAccept(uint16_t addrTo, uint8_t customByte = 0);
|
void sendAccept(uint16_t addrTo, uint8_t customByte = 0);
|
||||||
void sendRequest(uint16_t addrTo);
|
void sendRequest(uint16_t addrTo);
|
||||||
void sendBack(uint8_t* data = nullptr, uint8_t len = 0);
|
void sendBack(uint8_t* data = nullptr, uint8_t len = 0);
|
||||||
void sendBackTo(uint16_t addrTo, uint8_t* data = nullptr, uint8_t len = 0);
|
void sendBackTo(uint16_t addrTo, uint8_t* data = nullptr, uint8_t len = 0);
|
||||||
void isr();
|
|
||||||
|
|
||||||
|
void isr();
|
||||||
|
|
||||||
~IR_Encoder();
|
~IR_Encoder();
|
||||||
volatile bool ir_out_virtual;
|
volatile bool ir_out_virtual;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user