mirror of
https://github.com/Show-maket/IR-protocol.git
synced 2025-09-13 11:32:36 +00:00
max pack
This commit is contained in:
@ -139,6 +139,7 @@ void IR_Encoder::sendDataFULL(uint16_t addrFrom, uint16_t addrTo, uint8_t *data,
|
||||
{
|
||||
if (len > bytePerPack)
|
||||
{
|
||||
Serial.println("IR Pack to big");
|
||||
return;
|
||||
}
|
||||
constexpr uint8_t dataStart = msgBytes + addrBytes + addrBytes;
|
||||
@ -168,6 +169,19 @@ void IR_Encoder::sendDataFULL(uint16_t addrFrom, uint16_t addrTo, uint8_t *data,
|
||||
sendBuffer[packSize - crcBytes] = crc8(sendBuffer, 0, packSize - crcBytes, poly1) & 0xFF;
|
||||
sendBuffer[packSize - crcBytes + 1] = crc8(sendBuffer, 0, packSize - crcBytes + 1, poly2) & 0xFF;
|
||||
|
||||
//* вывод итогового буфера
|
||||
// Serial.print("IR SEND [len=");
|
||||
// Serial.print(packSize);
|
||||
// Serial.print("] : ");
|
||||
// for (uint8_t i = 0; i < packSize; i++)
|
||||
// {
|
||||
// if (sendBuffer[i] < 0x10)
|
||||
// Serial.print('0');
|
||||
// Serial.print(sendBuffer[i], HEX);
|
||||
// Serial.print(' ');
|
||||
// }
|
||||
// Serial.println();
|
||||
|
||||
// if (decPair != nullptr) {
|
||||
// decPair->isWaitingAccept = ((msgType >> 5) & IR_MASK_MSG_TYPE == IR_MSG_DATA_ACCEPT);
|
||||
// if (decPair->isWaitingAccept) {
|
||||
@ -179,6 +193,7 @@ void IR_Encoder::sendDataFULL(uint16_t addrFrom, uint16_t addrTo, uint8_t *data,
|
||||
rawSend(sendBuffer, packSize);
|
||||
}
|
||||
|
||||
|
||||
void IR_Encoder::sendAccept(uint16_t addrTo, uint8_t customByte)
|
||||
{
|
||||
constexpr uint8_t packsize = msgBytes + addrBytes + 1U + crcBytes;
|
||||
|
Reference in New Issue
Block a user