specify port at command line
[huawei.git] / 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";