1
0

runcommand.gcom 516 B

12345678910111213141516171819202122232425262728293031
  1. # run AT-command from environment
  2. opengt
  3. set com 115200n81
  4. set senddelay 0.02
  5. waitquiet 1 0.2
  6. flash 0.1
  7. :start
  8. print "sending -> ",$env("COMMAND"),"\n"
  9. send $env("COMMAND")
  10. send "^m"
  11. waitfor 15 "OK","ERR","ERROR","COMMAND NOT SUPPORT"
  12. if % = 0 goto continue
  13. if % = 1 goto error
  14. if % = 2 goto error
  15. if % = 3 goto notsupported
  16. print "Timeout running AT-command\n"
  17. exit 1
  18. :error
  19. print "Error running AT-command\n"
  20. exit 1
  21. :notsupported
  22. print "AT-command not supported\n"
  23. exit 1
  24. :continue
  25. exit 0