private fork

Fork of GSwifiInterface by gs fan

Revision:
10:7d8134e7df01
Parent:
8:64184a968e3b
Child:
11:71d67fea5ace
--- a/GSwifi/GSwifi_at.cpp	Thu Oct 31 06:59:46 2013 +0000
+++ b/GSwifi/GSwifi_at.cpp	Thu Oct 31 08:34:45 2013 +0000
@@ -22,7 +22,7 @@
     _state.ok = false;
     _state.failure = false;
     _state.res = RES_NULL;
-    _state.mode = MODE_COMMAND;
+    _state.n = 0;
 }
 
 int GSwifi::sendCommand(const char * cmd, Response res, int timeout) {
@@ -33,7 +33,6 @@
 
     clearFlags();
     _state.res = res;
-    _state.n = 0;
     for (i = 0; i < strlen(cmd); i ++) {
         putUart(cmd[i]);
     }
@@ -45,7 +44,7 @@
     if (timeout) {
         t.start();
         for (;;) {
-            if (_state.ok) break;
+            if (_state.ok && _state.res == RES_NULL) break;
             if (_state.failure || t.read_ms() > timeout) {
                 WARN("failure or timeout\r\n");
                 _state.res = RES_NULL;