/[RFID]/3m-810.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /3m-810.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 49 by dpavlin, Tue Jun 23 14:59:53 2009 UTC revision 50 by dpavlin, Wed Jun 24 09:30:28 2009 UTC
# Line 12  use JSON; Line 12  use JSON;
12    
13  use IO::Socket::INET;  use IO::Socket::INET;
14    
15    my $debug = 0;
16    
17  my $meteor_server = '192.168.1.13:4671';  my $meteor_server = '192.168.1.13:4671';
18  my $meteor_fh;  my $meteor_fh;
19    
# Line 78  sub http_server { Line 80  sub http_server {
80                  $client->autoflush(1);                  $client->autoflush(1);
81                  my $request = <$client>;                  my $request = <$client>;
82    
83                  warn "<< $request\n";                  warn "WEB << $request\n" if $debug;
84    
85                  if ($request =~ m{^GET (/.*) HTTP/1.[01]}) {                  if ($request =~ m{^GET (/.*) HTTP/1.[01]}) {
86                          my $method = $1;                          my $method = $1;
# Line 88  sub http_server { Line 90  sub http_server {
90                                          my ($n,$v) = split(/=/, $p, 2);                                          my ($n,$v) = split(/=/, $p, 2);
91                                          $param->{$n} = $v;                                          $param->{$n} = $v;
92                                  }                                  }
93                                  warn "<< param: ",dump( $param );                                  warn "WEB << param: ",dump( $param ) if $debug;
94                          }                          }
95                          if ( my $path = static( $client,$1 ) ) {                          if ( my $path = static( $client,$1 ) ) {
96                                  warn ">> $path";                                  warn "WEB >> $path" if $debug;
97                          } elsif ( $method =~ m{/scan} ) {                          } elsif ( $method =~ m{/scan} ) {
98                                  my $tags = scan_for_tags();                                  my $tags = scan_for_tags();
99                                  my $json = {};                                  my $json = {};
# Line 129  sub _message { Line 131  sub _message {
131  sub _log { _message('log',@_) };  sub _log { _message('log',@_) };
132  sub diag { _message('diag',@_) };  sub diag { _message('diag',@_) };
133    
 my $debug = 0;  
   
134  my $device    = "/dev/ttyUSB0";  my $device    = "/dev/ttyUSB0";
135  my $baudrate  = "19200";  my $baudrate  = "19200";
136  my $databits  = "8";  my $databits  = "8";

Legend:
Removed from v.49  
changed lines
  Added in v.50

  ViewVC Help
Powered by ViewVC 1.1.26