32 lines
492 B
Plaintext
32 lines
492 B
Plaintext
opengt
|
|
set com 115200n81
|
|
set comecho off
|
|
set senddelay 0.05
|
|
waitquiet 1 0.2
|
|
|
|
:start
|
|
let $g=$env("TIMEOUT")
|
|
if $g = "" let f=25
|
|
else let f = val($g)
|
|
|
|
let $x=$env("ATCMD")
|
|
send $x
|
|
send "^m"
|
|
let t=time()+f
|
|
gosub getresult
|
|
if $s="^mTIMEOUT ERROR" print $s
|
|
|
|
:continue
|
|
exit 0
|
|
|
|
:getresult
|
|
get 1 "^m" $s
|
|
let x=len($s)
|
|
if x=0 let $s="^mTIMEOUT ERROR"
|
|
else print $s
|
|
if $s="^jCONNECT" return
|
|
if $mid($s,0,6)="^jERROR" return
|
|
if $mid($s,0,11)="^j+CME ERROR" return
|
|
if time()>t return
|
|
goto getresult
|