7 our @EXPORT = qw( hex2bytes as_hex hex_tag );
9 use Data::Dump qw(dump);
13 RFID::Biblio - easy to use API for writing RFID enabled appliaction
17 our $VERSION = '0.02';
24 This module tries to support USB serial RFID readers wsing simple API
25 which is sutable for direct mapping to REST JSONP service.
27 For implementing application take a look at L<RFID::Biblio::Reader>
29 =head1 READER IMPLEMENTATION
31 Each reader must implement following hooks as sub-classes.
39 my @tags = $self->invetory;
43 my $hash = $self->read_blocks( $tag );
45 All blocks are under key which is tag UID with array of blocks returned from reader
47 $hash = { 'E000000123456789' => [ 'blk1', 'blk2', ... ] };
49 L<RFID::Biblio::Reader::3M810> sends tag UID with data payload, so we might expect
50 to receive response from other tags from protocol specification,
54 $self->write_blocks( $tag => $bytes );
56 $self->write_blocks( $tag => [ 'blk1', 'blk2', ... ] );
60 my $afi = $self->read_afi( $tag );
64 $self->write_afi( $tag => $afi );
70 Formatting functions are exported
74 my $bytes = hex2bytes($hex);
79 my $str = shift || die "no str?";
86 warn "## str2bytes( $str ) => $b => ",as_hex($bytes) if $debug;
92 print as_hex( $bytes );
98 foreach my $str ( @_ ) {
99 my $hex = uc unpack( 'H*', $str );
100 $hex =~ s/(..)/$1 /g if length( $str ) > 2;
104 return join(' | ', @out);
109 print hex_tag $8bytes;
113 sub hex_tag { uc(unpack('H16', shift)) }
116 =head1 SUPPORTED READERS
118 Support for different RFID readers is implemented in subclasses:
122 L<RFID::Biblio::Reader::3M810>
126 L<RFID::Biblio::Reader::CPRM02>
130 L<RFID::Biblio::Reader::librfid>
134 Dobrica Pavlinusic, C<< <dpavlin at rot13.org> >>
138 Please report any bugs or feature requests to C<bug-rfid-serial at rt.cpan.org>, or through
139 the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=RFID-Biblio>. I will be notified, and then you'll
140 automatically be notified of progress on your bug as I make changes.
147 You can find documentation for this module with the perldoc command.
152 You can also look for information at:
156 =item * RT: CPAN's request tracker
158 L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=RFID-Biblio>
160 =item * AnnoCPAN: Annotated CPAN documentation
162 L<http://annocpan.org/dist/RFID-Biblio>
166 L<http://cpanratings.perl.org/d/RFID-Biblio>
170 L<http://search.cpan.org/dist/RFID-Biblio/>
175 =head1 ACKNOWLEDGEMENTS
178 =head1 LICENSE AND COPYRIGHT
180 Copyright 2010 Dobrica Pavlinusic.
182 This program is free software; you can redistribute it and/or modify
183 it under the terms of the GNU General Public License as published by
184 the Free Software Foundation; version 2 dated June, 1991 or at your option
187 This program is distributed in the hope that it will be useful,
188 but WITHOUT ANY WARRANTY; without even the implied warranty of
189 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
190 GNU General Public License for more details.
192 A copy of the GNU General Public License is available in the source tree;
193 if not, write to the Free Software Foundation, Inc.,
194 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
199 1; # End of RFID::Biblio