specify port at command line
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 29 Jan 2012 12:49:53 +0000 (13:49 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 29 Jan 2012 12:49:53 +0000 (13:49 +0100)
qcdm.pl

diff --git a/qcdm.pl b/qcdm.pl
index 693e48d..03b20e2 100755 (executable)
--- a/qcdm.pl
+++ b/qcdm.pl
@@ -53,7 +53,7 @@ sub crc {
 
 
 
 
 
 
-my $device = $ENV{DEVICE} || '/dev/ttyUSB2'; # last device! control port!
+my $device = shift @ARGV || $ENV{DEVICE} || '/dev/ttyUSB2'; # last device! control port!
 
 my $port = Device::SerialPort->new( $device ) || die "$device: $!";
 $port->baudrate(115200) || die "fail $device baudrate";
 
 my $port = Device::SerialPort->new( $device ) || die "$device: $!";
 $port->baudrate(115200) || die "fail $device baudrate";