Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
fix checksumReceived bug
Browse files Browse the repository at this point in the history
  • Loading branch information
MPIBR-tushevg committed Jan 4, 2019
1 parent f681987 commit 1ea29c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion BrainATUMtome/serialpackage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ QString SerialPackage::parse(bool &ok, const QString &message)
quint8 checksumReceived = 0;
if (!unpack(checksumReceived, buffer.mid(buffer.size() - 2, 2)))
ok = false;
ok = (checksumReceived == checksum(message));

// remove checksum from buffer
buffer.remove(buffer.size() - 2, 2);
ok = (checksumReceived == checksum(buffer));

return buffer;
}
Expand Down

0 comments on commit 1ea29c5

Please sign in to comment.