specify port at command line
[huawei.git] / qcdm.pl
diff --git a/qcdm.pl b/qcdm.pl
index 21a1673..693e48d 100755 (executable)
--- a/qcdm.pl
+++ b/qcdm.pl
@@ -72,7 +72,11 @@ $port->read_char_time(3000);  # 5 s char timeout
 $port->read_const_time(3000); # 1 s read timeout
 
 while ( my $drain = $port->input ) {
-       warn "# drain $drain\n# /drain\n";
+       warn "# drain $drain\n";
+
+       $port->write('AT$QCDMG' . "\r");
+       warn "DIAG mode: ", $port->read(2), $port->input; # OK+cr/lf
+
 }
 
 my $diag = {
@@ -97,9 +101,6 @@ my $diag = {
 
 warn "## using $device\n";
 
-#$port->write('AT$QCDMG');
-#warn "DIAG mode: ", $port->read(2), $port->input; # OK+cr/lf
-
 sub as_hex {
     my @out;
     foreach my $str ( @_ ) {