--- 3m-810.pl 2009/04/06 21:28:02 32 +++ 3m-810.pl 2009/04/08 14:48:22 33 @@ -268,13 +268,27 @@ } ); + my $security; + + cmd( + "D6 00 0B 0A $tag 1234", "check security $tag", + "D6 00 0D 0A 00", sub { + my $rest = shift; + my $from_tag; + ( $from_tag, $security ) = ( substr($rest,0,8), substr($rest,8,1) ); + die "security from other tag: ",as_hex( $from_tag ) if $from_tag ne str2bytes( $tag ); + $security = as_hex( $security ); + warn "# SECURITY $tag = $security\n"; + } + ); + my $data = $tags_data->{$tag} || die "no data for $tag"; my ( $u1, $set_item, $u2, $type, $content, $br_lib, $custom ) = unpack('C4Z16Nl>',$data); my $set = ( $set_item & 0xf0 ) >> 4; my $total = ( $set_item & 0x0f ); my $branch = $br_lib >> 20; my $library = $br_lib & 0x000fffff; - print "TAG $tag [$u1] set: $set/$total [$u2] type: $type '$content' branch: $branch library: $library custom: $custom\n"; + print "TAG $tag [$u1] set: $set/$total [$u2] type: $type '$content' branch: $branch library: $library custom: $custom security: $security\n"; }