-my @readers = ( '3M810', 'CPRM02' );
-my @rfid;
-
-foreach my $reader ( @readers ) {
- next if $reader !~ /$only/i && $only ne $reader;
- my $module = "RFID::Biblio::$reader";
- eval "use $module";
- die $@ if $@;
- if ( my $rfid = $module->new( device => '/dev/ttyUSB0' ) ) {
- push @rfid, $rfid;
- warn "# added $module\n";
- } else {
- warn "# ignored $module\n";
- }
+my $rfid = Biblio::RFID::Reader->new( $reader );
+$Biblio::RFID::debug = $debug;
+
+sub tag {
+ my $tag = shift;
+ return $tag
+ , " AFI: "
+ , uc unpack('H2', $rfid->afi($tag))
+ , " "
+ , dump( Biblio::RFID::RFID501->to_hash( $rfid->blocks($tag) ) )
+ , $/
+ ;