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:
9891805
)
don't die if we can't read tag
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Tue, 27 Jul 2010 11:52:02 +0000
(13:52 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Tue, 27 Jul 2010 11:52:02 +0000
(13:52 +0200)
lib/RFID/Serial.pm
patch
|
blob
|
history
diff --git
a/lib/RFID/Serial.pm
b/lib/RFID/Serial.pm
index
e9435f6
..
80a78d7
100644
(file)
--- a/
lib/RFID/Serial.pm
+++ b/
lib/RFID/Serial.pm
@@
-91,7
+91,15
@@
sub scan {
my $visible;
# FIXME this is naive implementation which just discards other tags
- $visible->{$_} = $self->read_blocks( $_ )->{$_} foreach @tags;
+ foreach my $tag ( @tags ) {
+ my $blocks = $self->read_blocks( $tag );
+ if ( ! $blocks ) {
+ warn "ERROR: can't read tag $tag\n";
+ delete $visible->{$tag};
+ } else {
+ $visible->{$tag} = $blocks->{$tag};
+ }
+ }
return $visible;
}