Skip to content

Commit

Permalink
Update src/decoder.rs
Browse files Browse the repository at this point in the history
Co-authored-by: João Antônio Cardoso <[email protected]>
  • Loading branch information
RaulTrombin and joaoantoniocardoso authored Apr 4, 2024
1 parent f923256 commit 5427e79
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,11 @@ impl Decoder {
self.reset();
let message = self.message.clone();
self.message = ProtocolMessage::new();
if message.has_valid_crc() {
return DecoderResult::Success(message);
if !message.has_valid_crc() {
return DecoderResult::Error(ParseError::ChecksumError(message));
}
return DecoderResult::Error(ParseError::ChecksumError(message));

return DecoderResult::Success(message);
}
return DecoderResult::InProgress;
}
Expand Down

0 comments on commit 5427e79

Please sign in to comment.