invalidate tags after going through all reader
authorDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 11 Feb 2014 13:39:41 +0000 (14:39 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 11 Feb 2014 13:39:41 +0000 (14:39 +0100)
This allows correct enter/leave events if more than one reader is
connected to same computer

lib/Biblio/RFID/Reader.pm

index 13b8895..0ec702e 100644 (file)
@@ -79,11 +79,11 @@ sub tags {
 
                }
        
 
                }
        
-               foreach my $tag ( grep { $self->{_tags}->{$_}->{time} == 0 } keys %{ $self->{_tags} } ) {
-                       $triggers->{leave}->( $tag ) if $triggers->{leave};
-                       $self->_invalidate_tag( $tag );
-               }
+       }
 
 
+       foreach my $tag ( grep { $self->{_tags}->{$_}->{time} == 0 } keys %{ $self->{_tags} } ) {
+               $triggers->{leave}->( $tag ) if $triggers->{leave};
+               $self->_invalidate_tag( $tag );
        }
 
        warn "## _tags ",dump( $self->{_tags} );
        }
 
        warn "## _tags ",dump( $self->{_tags} );