Skip to content

Commit

Permalink
use v2 checksum??
Browse files Browse the repository at this point in the history
  • Loading branch information
laptou committed Mar 27, 2023
1 parent 18b6696 commit feb7a99
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion simplebgc/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ impl From<std::io::Error> for MessageParseError {
}
}



pub trait Message {
fn command_id(&self) -> u8;

Expand Down Expand Up @@ -81,7 +83,7 @@ pub trait Message {
buf.put_u8(header_checksum);
buf.put(payload);

let payload_checksum = crc16::State::<crc16::ARC>::calculate(&buf[1..]);
let payload_checksum = checksum_bgc_v2(&buf[1..]);
buf.put_u16_le(payload_checksum);

buf.freeze()
Expand Down

0 comments on commit feb7a99

Please sign in to comment.