2014-10-10 08:56:33 +00:00
|
|
|
# run AT-command from environment
|
|
|
|
opengt
|
|
|
|
set com 115200n81
|
|
|
|
set senddelay 0.02
|
|
|
|
waitquiet 1 0.2
|
|
|
|
flash 0.1
|
|
|
|
|
|
|
|
:start
|
2015-01-28 19:19:33 +00:00
|
|
|
print "sending -> ",$env("COMMAND"),"\n"
|
2014-10-10 08:56:33 +00:00
|
|
|
send $env("COMMAND")
|
2014-10-26 16:57:38 +00:00
|
|
|
send "^m"
|
2014-10-10 08:56:33 +00:00
|
|
|
|
2015-01-28 19:19:33 +00:00
|
|
|
waitfor 15 "OK","ERR","ERROR","COMMAND NOT SUPPORT"
|
2014-10-10 08:56:33 +00:00
|
|
|
if % = 0 goto continue
|
|
|
|
if % = 1 goto error
|
|
|
|
if % = 2 goto error
|
2015-01-28 19:19:33 +00:00
|
|
|
if % = 3 goto notsupported
|
2014-10-10 08:56:33 +00:00
|
|
|
|
|
|
|
print "Timeout running AT-command\n"
|
|
|
|
exit 1
|
|
|
|
|
|
|
|
:error
|
|
|
|
print "Error running AT-command\n"
|
|
|
|
exit 1
|
|
|
|
|
2015-01-28 19:19:33 +00:00
|
|
|
:notsupported
|
|
|
|
print "AT-command not supported\n"
|
|
|
|
exit 1
|
|
|
|
|
2014-10-10 08:56:33 +00:00
|
|
|
:continue
|
|
|
|
exit 0
|