#!/usr/bin/env perl
use strict;
use warnings;
use Win32::SerialPort;
$|=1;
my $serDev = $ARGV[0] || 'COM3';
my $serSpeed = $ARGV[1] || 115200;
my $serDB = $ARGV[2] || 8;
my $serPA = $ARGV[3] || 'none';
my $serSB = $ARGV[4] || 1;
my $port = new Win32::SerialPort($serDev);
$port->databits($serDB);
$port->baudrate($serSpeed);
$port->parity($serPA);
$port->stopbits($serSB);
$port->write_settings || undef $port;
unless ($port) {
print "Serial port: $serDev not found, use\n\n";
print " $0 <device> <speed> <baud> <parity> <stopbits>\n\n";
print " $0 /dev/ttyACM0 115200 8 none 1\n\n";
exit;
}
$port->write("PAGE\n");
sleep(3);
$port->write("PAGE\n");