projects
/
Biblio-RFID.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
660dd42
)
added _invalidate_tag and call it on write AUTOLOAD calls
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Fri, 6 Aug 2010 21:12:30 +0000
(23:12 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Fri, 6 Aug 2010 21:12:30 +0000
(23:12 +0200)
lib/RFID/Biblio/Reader.pm
patch
|
blob
|
history
diff --git
a/lib/RFID/Biblio/Reader.pm
b/lib/RFID/Biblio/Reader.pm
index
68af963
..
c7ee687
100644
(file)
--- a/
lib/RFID/Biblio/Reader.pm
+++ b/
lib/RFID/Biblio/Reader.pm
@@
-12,6
+12,11
@@
use RFID::Biblio;
RFID::Biblio::Reader - simple way to write RFID applications in perl
RFID::Biblio::Reader - simple way to write RFID applications in perl
+=head1 DESCRIPTION
+
+This module will probe all available readers and use calls from
+L<RFID::Biblio::Reader::API> to invoke correct reader.
+
=head1 FUNCTIONS
=head2 new
=head1 FUNCTIONS
=head2 new
@@
-85,6
+90,20
@@
sub afi { $_[0]->{ 'afi' }->{$_[1]} || die "no afi for $_[1]"; };
=head1 PRIVATE
=head1 PRIVATE
+=head2 _invalidate_tag
+
+ $rfid->_invalidate_tag( $tag );
+
+=cut
+
+sub _invalidate_tag {
+ my ( $self, $tag ) = @_;
+ delete $self->{'blocks'}->{$tag};
+ delete $self->{'afi'}->{$tag};
+ delete $self->{'inventory'}->{$tag};
+ warn "# _invalidate_tag $tag";
+}
+
=head2 _available
Probe each RFID reader supported and returns succefull ones
=head2 _available
Probe each RFID reader supported and returns succefull ones
@@
-143,6
+162,8
@@
sub AUTOLOAD {
push @out, $r->$command(@_);
}
push @out, $r->$command(@_);
}
+ $self->_invalidate_tag( $_[0] ) if $command =~ m/write/;
+
return @out;
}
return @out;
}