Implemented all

This commit is contained in:
2025-11-11 22:39:18 +01:00
parent 1ce1537487
commit 4b8073c614
7 changed files with 327 additions and 39 deletions

View File

@@ -46,4 +46,10 @@ mod tests {
};
assert_eq!(calculate_checksum(test_msg.telegram_length, test_msg.message_identifier, test_msg.function_code, test_msg.data_address, test_msg.data_length, &test_msg.data), 0x8D);
}
#[test]
fn test_received_message_wrapping_add_from_bytes() {
let checksum = calculate_checksum(0x06, MessageIdentifier::Request, FunctionCode::VirtualWRITE, 0x2323, 0x01, &[0xB6]);
assert_eq!(checksum, 0x05);
}
}