#!/usr/bin/perl

 use Device::SerialPort;

$Device="/dev/ttyUSB1";

 $port= Device::SerialPort->new($Device) ||
    die("Can't open $port: $^E\n");

 $port->user_msg(ON);
 $port->baudrate(115200);
 $port->parity("none");
 $port->stopbits(1);
 $port->databits(8);
 $port->handshake("none");
 $port->write_settings || undef $port;
 $port->read_char_time(1); # Wait for each character

 ($port->write("rx\r") == 3) ||
    die("Issuing command rx for delivery of response string failed!\n");

 ($count,$saw)=$port->read(72);
 printf $Device;
 if ($saw eq ""){
   printf "  << Error nothing reported >>\n";
 } else {
 printf " %s\n",$saw;
 }

 $port->close || 
   die("Serial port failed to close!\n");
 undef $port;

 exit 0;

