Commit 9cebfd49 authored by Lorenz Meier's avatar Lorenz Meier

Merge pull request #44 from ARCADE-UAV/error_rate_fix

Fixed error rate peaks when packet arrive out-of order
parents b4ff79bf 42e3368f
......@@ -370,10 +370,13 @@ void MAVLinkProtocol::receiveBytes(LinkInterface* link, QByteArray b)
int16_t lostMessages = message.seq - expectedIndex;
if (lostMessages < 0)
{
lostMessages += 256;
// Usually, this happens in the case of an out-of order packet
lostMessages = 0;
}
else
{
qDebug() << QString("Lost %1 messages: expected sequence ID %2 but received %3.").arg(lostMessages).arg(expectedIndex).arg(message.seq);
}
totalLossCounter += lostMessages;
currLossCounter += lostMessages;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment