FIX: occasional endless loop (wrong buffer limit) (#234)

Co-authored-by: Waldemar Porscha <wp@porscha.eu>
This commit is contained in:
mumpf 2023-03-20 14:41:31 +01:00 committed by GitHub
parent 4c37c21699
commit 8807780b55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -335,7 +335,7 @@ void TpUartDataLinkLayer::loop()
#ifdef DBG_TRACE
print(rxByte, HEX);
#endif
if (_RxByteCnt == MAX_KNX_TELEGRAM_SIZE)
if (_RxByteCnt == MAX_KNX_TELEGRAM_SIZE - 2)
{
println("invalid telegram size");
enterRxWaitEOP();
@ -401,6 +401,8 @@ void TpUartDataLinkLayer::loop()
}
break;
default:
println("invalid _rxState");
enterRxWaitEOP();
break;
}
} while (_rxState == RX_L_ADDR && (stayInRx || _platform.uartAvailable()));