--- 3m-810.pl 2008/10/04 11:55:30 22
+++ 3m-810.pl 2009/03/28 03:47:10 23
@@ -8,6 +8,16 @@
use Carp qw/confess/;
use Getopt::Long;
+use IO::Socket::INET;
+
+my $meteor = IO::Socket::INET->new( '192.168.1.13:4671' ) || die "can't connect to meteor: $!";
+
+sub meteor {
+ my ( $item, $html ) = @_;
+ warn ">> meteor $item $html\n";
+ print $meteor "ADDMESSAGE test $item|" . localtime() . "
$html\n";
+}
+
my $debug = 0;
my $device = "/dev/ttyUSB0";
@@ -72,6 +82,9 @@
=cut
+my $tags_data;
+my $visible_tags;
+
my $port=new Device::SerialPort($device) || die "can't open serial port $device: $!\n";
warn "using $device $handshake $baudrate $databits $parity $stopbits" if $debug;
$handshake=$port->handshake($handshake);
@@ -95,7 +108,9 @@
cmd( 'D5 00 05 04 00 11 8C66', 'hw version',
'D5 00 09 04 00 11 0A 05 00 02 7250', sub {
- print "hardware version ", join('.', unpack('CCCC', skip_assert(3) )), "\n";
+ my $hw_ver = join('.', unpack('CCCC', skip_assert(3) ));
+ print "hardware version $hw_ver\n";
+ meteor( -1, "Found reader $hw_ver" );
});
cmd( 'D6 00 0C 13 04 01 00 02 00 03 00 04 00 AAF2','FIXME: stats?',
@@ -111,6 +126,7 @@
if ( ! $nr ) {
print "no tags in range\n";
update_visible_tags();
+ meteor( -1, "No tags in range" );
} else {
my $tags = substr( $rest, 1 );
@@ -125,15 +141,14 @@
update_visible_tags( @tags );
+ my $html = join('', map { "