6 use Data::Dump qw(dump);
9 use Biblio::RFID::Reader;
10 use Biblio::RFID::RFID501;
18 'reader=s', => \$reader,
21 'set=i' => \$hash->{set},
22 'total=i', => \$hash->{total},
23 'type=i', => \$hash->{type},
24 'branch=i', => \$hash->{branch},
25 'library=i' => \$hash->{library},
28 my ( $sid, $content ) = @ARGV;
29 die "usage: $0 [--reader regex_filter] [--afi 214] [--type 1] E0_RFID_SID [barcode]\n" unless $sid && ( $content | $afi );
31 $hash->{content} = $content if defined $content;
33 my $rfid = Biblio::RFID::Reader->new( $reader );
34 $Biblio::RFID::debug = $debug;
36 foreach my $tag ( $rfid->tags ) {
37 warn "visible $tag\n";
38 next unless $tag eq $sid;
39 warn "PROGRAM $tag with $content\n";
40 $rfid->write_blocks( $tag => Biblio::RFID::RFID501->from_hash($hash) );
41 $rfid->write_afi( $tag => chr($afi) ) if $afi;