--- 3m-810.pl 2010/02/11 12:33:19 64 +++ 3m-810.pl 2010/02/11 13:23:26 65 @@ -407,13 +407,13 @@ while ( $start_block < $max_rfid_block ) { cmd( - sprintf( "D6 00 0D 02 $tag %02x %02x ffff", $start_block, $read_blocks ), + sprintf( "D6 00 0D 02 $tag %02x %02x BEEF", $start_block, $read_blocks ), "read $tag offset: $start_block blocks: $read_blocks", "D6 00 1F 02 00", sub { # $tag 03 00 00 04 11 00 01 01 00 31 32 33 34 02 00 35 36 37 38 531F\n"; $start_block = read_tag_data( $start_block, @_ ); warn "# read tag upto $start_block\n"; }, - "D6 00 0F FE 00 00 05 01 $tag 941A", sub { + "D6 00 0F FE 00 00 05 01 $tag BEEF", sub { print "FIXME: tag $tag ready? (expected block read instead)\n"; }, ); @@ -423,7 +423,7 @@ my $security; cmd( - "D6 00 0B 0A $tag 1234", "check security $tag", + "D6 00 0B 0A $tag BEEF", "check security $tag", "D6 00 0D 0A 00", sub { my $rest = shift; my $from_tag; @@ -473,8 +473,8 @@ print "write_tag $tag = ",dump( $data ), " [$len/$blocks] == $hex_data\n"; cmd( - "d6 00 ff 04 $tag 00 $blocks 00 $hex_data ffff", "write $tag", - "d6 00 0d 04 00 $tag $blocks afb1", sub { assert() }, + "d6 00 ff 04 $tag 00 $blocks 00 $hex_data BEEF", "write $tag", + "d6 00 0d 04 00 $tag $blocks BEEF", sub { assert() }, ); # foreach ( 1 .. 3 ); # XXX 3m software does this three times! my $to = $path; @@ -495,8 +495,8 @@ my $data = substr(read_file( $path ),0,2); cmd( - "d6 00 0c 09 $tag $data 1234", "secure $tag -> $data", - "d6 00 0c 09 00 $tag 1234", sub { assert() }, + "d6 00 0c 09 $tag $data BEEF", "secure $tag -> $data", + "d6 00 0c 09 00 $tag BEEF", sub { assert() }, ); my $to = $path; @@ -618,7 +618,7 @@ warn "## checksum ",dump( $bytes, $xor, $checksum ) if $debug; if ( defined $checksum && $xor ne $checksum ) { - print "checksum doesn't match: ", as_hex($xor), " != ", as_hex($checksum), " data: ", as_hex($bytes), "\n"; + warn "checksum error: ", as_hex($xor), " != ", as_hex($checksum), " data: ", as_hex($bytes), "\n" if $checksum ne "\xBE\xEF"; return $bytes . $xor; } return $bytes . $checksum;