Communication: Ignore empty LIN frames for checksum

This commit is contained in:
Jonathan Schwartz
2025-03-21 18:04:45 +00:00
committed by Kyle Schwarz
parent 538d6ec0c8
commit e1a0ca056a
+1 -1
View File
@@ -31,7 +31,7 @@ std::shared_ptr<Message> HardwareLINPacket::DecodeToMessage(const std::vector<ui
auto isChecksumInvalid = [&]() -> bool { auto isChecksumInvalid = [&]() -> bool {
/* messages with no data have no checksum (e.g. header only) */ /* messages with no data have no checksum (e.g. header only) */
if(!msg->data.size()) if(!msg->data.size())
return true; return false;
uint8_t checkSum = (8 > numDataBytes) ? *(dataStart + numDataBytes) : packet->CoreMiniBitsLIN.LINByte9; uint8_t checkSum = (8 > numDataBytes) ? *(dataStart + numDataBytes) : packet->CoreMiniBitsLIN.LINByte9;
LINMessage::calcChecksum(*msg); LINMessage::calcChecksum(*msg);