getcarrier.gcom 312 B

1234567891011121314151617181920
  1. opengt
  2. set senddelay 0.05
  3. waitquiet 1 0.2
  4. let c=1
  5. :loop
  6. inc c
  7. send "AT+CGATT?^m"
  8. waitfor 5 "+CGATT: 1","+CGATT: 0"
  9. print "\n."
  10. if % = -1 goto error
  11. if c > 10 goto toolong
  12. if % = 0 goto out
  13. sleep 2
  14. if % = 1 goto loop
  15. :toolong
  16. exit 1
  17. :error
  18. exit 0
  19. :out
  20. exit 0