This commit is contained in:
2025-08-22 15:33:19 +03:00
parent bc9563fbb5
commit dec8467280
2 changed files with 17 additions and 2 deletions

View File

@ -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;