mirror of
https://github.com/Show-maket/IR-protocol.git
synced 2025-06-28 05:09:40 +00:00
add simple sendData
This commit is contained in:
@ -33,6 +33,13 @@ IR_Encoder::~IR_Encoder() {
|
||||
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) {
|
||||
if (len > bytePerPack) { return; }
|
||||
constexpr uint8_t dataStart = msgBytes + addrBytes + addrBytes;
|
||||
|
Reference in New Issue
Block a user