6 use Data::Dump qw(dump);
9 use Biblio::RFID::Reader;
10 use Biblio::RFID::RFID501;
19 'reader=s', => \$reader,
22 'set=i' => \$hash->{set},
23 'total=i', => \$hash->{total},
24 'type=i', => \$hash->{type},
25 'branch=i', => \$hash->{branch},
26 'library=i' => \$hash->{library},
27 '3mblank' => \$blank->{blank_3m},
28 'blank' => \$blank->{blank},
31 my ( $sid, $content ) = @ARGV;
32 die "usage: $0 [--reader regex_filter] [--afi 214] [--type 1] E0_RFID_SID [barcode]\n" unless $sid && ( $content | $afi | $blank );
34 $hash->{content} = $content if defined $content;
36 my $rfid = Biblio::RFID::Reader->new( $reader );
37 $Biblio::RFID::debug = $debug;
39 foreach my $tag ( $rfid->tags ) {
40 warn "visible $tag\n";
41 next unless $tag eq $sid;
44 my $type = ( grep { $blank->{$_} } keys %$blank )[0];
45 warn "BLANK $type $tag\n";
46 $rfid->write_blocks( $tag => Biblio::RFID::RFID501->$type );
48 warn "PROGRAM $tag with $content\n";
49 $rfid->write_blocks( $tag => Biblio::RFID::RFID501->from_hash($hash) );
50 $rfid->write_afi( $tag => chr($afi) ) if $afi;