223 |
# my $checksum = checksum( $bytes, $original_checksum ); |
# my $checksum = checksum( $bytes, $original_checksum ); |
224 |
sub checksum { |
sub checksum { |
225 |
my ( $bytes, $checksum ) = @_; |
my ( $bytes, $checksum ) = @_; |
226 |
my $xor = 0; |
|
227 |
|
my $xor = $checksum; # FIXME |
228 |
|
|
229 |
if ( defined $checksum && $xor ne $checksum ) { |
if ( defined $checksum && $xor ne $checksum ) { |
230 |
printf "checksum doesn't match: %04x != %04x data: %s\n", $xor, $checksum; |
print "checksum doesn't match: ", as_hex($xor), " != ", as_hex($checksum), " data: ", as_hex($bytes), "\n"; |
231 |
} |
} |
232 |
} |
} |
233 |
|
|