--- 3m-810.pl 2009/06/23 14:59:53 48 +++ 3m-810.pl 2009/06/24 10:13:23 51 @@ -12,6 +12,8 @@ use IO::Socket::INET; +my $debug = 0; + my $meteor_server = '192.168.1.13:4671'; my $meteor_fh; @@ -78,7 +80,7 @@ $client->autoflush(1); my $request = <$client>; - warn "<< $request\n"; + warn "WEB << $request\n" if $debug; if ($request =~ m{^GET (/.*) HTTP/1.[01]}) { my $method = $1; @@ -88,10 +90,10 @@ my ($n,$v) = split(/=/, $p, 2); $param->{$n} = $v; } - warn "<< param: ",dump( $param ); + warn "WEB << param: ",dump( $param ) if $debug; } if ( my $path = static( $client,$1 ) ) { - warn ">> $path"; + warn "WEB >> $path" if $debug; } elsif ( $method =~ m{/scan} ) { my $tags = scan_for_tags(); my $json = {}; @@ -129,8 +131,6 @@ sub _log { _message('log',@_) }; sub diag { _message('diag',@_) }; -my $debug = 0; - my $device = "/dev/ttyUSB0"; my $baudrate = "19200"; my $databits = "8"; @@ -309,6 +309,7 @@ $visible_tags = {}; foreach my $tag ( @tags ) { + $visible_tags->{$tag}++; if ( ! defined $last_visible_tags->{$tag} ) { if ( defined $tags_data->{$tag} ) { # meteor( 'in-range', $tag ); @@ -316,7 +317,6 @@ meteor( 'read', $tag ); read_tag( $tag ); } - $visible_tags->{$tag}++; } else { warn "## using cached data for $tag" if $debug; }