fix bug in echo detection

This commit is contained in:
Bernhard 2019-10-18 15:26:48 +02:00
parent 31fb516ae0
commit 6cf2011e58

View File

@ -235,13 +235,13 @@ void TpUartDataLinkLayer::loop()
//Destination Address + payload available //Destination Address + payload available
_xorSum ^= rxByte; _xorSum ^= rxByte;
//check if echo //check if echo
if (!((buffer[0] ^ _sendBuffer[0]) & ~0x20) && !memcmp(buffer + _convert + 1, _sendBuffer + 1, 5)) _isEcho = false;
{ //ignore repeated bit of control byte if(_sendBuffer != NULL)
_isEcho = true;
}
else
{ {
_isEcho = false; if (!((buffer[0] ^ _sendBuffer[0]) & ~0x20) && !memcmp(buffer + _convert + 1, _sendBuffer + 1, 5)) //ignore repeated bit of control byte
{
_isEcho = true;
}
} }
//convert into Extended.ind //convert into Extended.ind