3 use Time::HiRes qw(gettimeofday tv_interval);
7 my ($portname, $logfile) = @ARGV;
9 if (!defined $portname || !defined $logfile) {
10 die "Usage: $0 /dev/ttyUSB0 logfile\n";
13 my $reader = SCX::Reader->new({
14 portname => $portname,
16 callback => \&do_packet,
25 print "===== ", $data, " =====\n";
40 my $tty_reader = event_new($reader->fh, EV_READ, \&tty_read);
41 my $stdin_reader = event_new(\*STDIN, EV_READ, \&stdin_read);