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

index 0fc9411..37fa988 100755 (executable)
@@ -5,7 +5,7 @@ use strict;
 use Device::SerialPort;
 use Data::Dump qw(dump);
 
-my $device = $ENV{DEVICE} || '/dev/ttyUSB0';
+my $device = $ENV{DEVICE} || shift @ARGV || '/dev/ttyUSB0';
 
 my $port = Device::SerialPort->new( $device ) || die "$device: $!";
 $port->baudrate(115200) || die "fail $device baudrate";