diff --git a/src/libboard_artiq/src/cxp_proto.rs b/src/libboard_artiq/src/cxp_proto.rs index 69223a3..5e5c32f 100644 --- a/src/libboard_artiq/src/cxp_proto.rs +++ b/src/libboard_artiq/src/cxp_proto.rs @@ -172,10 +172,8 @@ impl Packet { writer.write(&data[0..length as usize])?; } - print_packet(&writer.get_ref()[4..writer.position()]); - - let checksum = crc32::checksum_ieee(&writer.get_ref()[4..writer.position()]); - writer.write(&(!checksum).to_le_bytes())?; + let checksum = (!crc::crc32::checksum_ieee(&writer.get_ref()[4..writer.position()])).swap_bytes(); + writer.write(&checksum.to_be_bytes())?; } _ => return Err(Error::UnknownPacket(0)), } @@ -188,8 +186,8 @@ impl Packet { | Packet::CtrlWrite { .. } | Packet::CtrlReadWithTag { .. } | Packet::CtrlWriteWithTag { .. } => { - let checksum = crc32::checksum_ieee(&writer.get_ref()[4..writer.position()]); - writer.write(&(!checksum).to_le_bytes())?; + let checksum = (!crc::crc32::checksum_ieee(&writer.get_ref()[4..writer.position()])).swap_bytes(); + writer.write(&checksum.to_be_bytes())?; } _ => {} }