--- 3m-810.pl 2010/07/06 15:05:44 80 +++ 3m-810.pl 2010/07/23 13:16:51 92 @@ -518,16 +518,26 @@ print "write_tag $tag = ",dump( $data ), " [$len/$blocks] == $hex_data\n"; + my $ok = 0; + cmd( "d6 00 ff 04 $tag 00 $blocks 00 $hex_data BEEF", "write $tag", - "d6 00 0d 04 00 $tag $blocks BEEF", sub { assert() }, + "d6 00 0d 06 00 $tag $blocks BEEF", sub { assert(); $ok++ }, + "d6 00 0d 04 06 ", sub { + my $data = shift; + warn "no tag ",as_hex( substr($data,0,8) ), " in range for write\n"; + }, ); # foreach ( 1 .. 3 ); # XXX 3m software does this three times! - my $to = $path; - $to .= '.' . time(); + if ( $ok ) { - rename $path, $to; - print ">> $to\n"; + my $to = $path; + $to .= '.' . time(); + + rename $path, $to; + print ">> $to\n"; + + } forget_tag $tag; } @@ -538,6 +548,10 @@ cmd( "d6 00 0c 09 $tag $data BEEF", "secure $tag -> $data", "d6 00 0c 09 00 $tag BEEF", sub { assert() }, + "d6 00 0c 09 06 ", sub { + my $data = shift; + warn "no tag ",as_hex( substr($data,0,8) ), " in range for secure\n"; + }, ); forget_tag $tag; @@ -712,7 +726,7 @@ warn "## DISPATCH payload to with rest", dump( $payload, $to, $rest ) if $debug; $dispatch->{ $to }->( $rest ); } else { - die "NO DISPATCH for ",as_hex( $full ),"\n"; + die "NO DISPATCH for ",as_hex( $full ), " in ", dump( $dispatch ); } return $data;