6 use Data::Dump qw(dump);
9 use Biblio::RFID::Reader;
10 use Biblio::RFID::RFID501;
19 'reader=s', => \$reader,
24 my $rfid = Biblio::RFID::Reader->new( $reader );
25 $Biblio::RFID::debug = $debug;
31 , uc unpack('H2', $rfid->afi($tag))
33 , dump( $rfid->to_hash( $tag ) )
41 my @t = localtime(time);
42 return sprintf "%04d-%02d-%02dT%02d:%02d:%02d", $t[5]+1900,$t[4]+1,$t[3],$t[2],$t[1],$t[0];
47 return if $saved->{tag} or ! $log;
48 my $hash = $rfid->to_hash( $tag );
49 open(my $fh, '>>', $log) || die "$log: $!";
50 print $fh iso_date,",$tag,", $hash->{content}, "\n";
55 my @visible = $rfid->tags(
58 print iso_date," reader ", $rfid->from_reader($tag), " enter ", tag($tag);
63 print iso_date," leave ", tag($tag);
67 warn iso_date," visible: ",join(' ',@visible),"\n";