A library for talking to Multi-Tech's Cellular SocketModem Devices.

Dependents:   M2X_dev axeda_wrapper_dev MTS_M2x_Example1 MTS_Cellular_Connect_Example ... more

Revision:
132:165b3a1084bd
Parent:
131:da8f0e1c264a
Child:
135:960c0b523f88
--- a/wifi/Wifi.cpp	Fri Jan 03 05:00:54 2014 +0000
+++ b/wifi/Wifi.cpp	Fri Jan 03 06:28:20 2014 +0000
@@ -49,16 +49,17 @@
     if(!sortInterfaceMode()) {
         return false;
     }
-
-    //cant do as a basic command after factory RESET, echo is on
-    //sendCommand("set uart mode 1", 1000, "set");
-    //wait(2.0f); // just wait a sec for the change
     
     //Set device to non-echo mode
     while (sendBasicCommand("set uart mode 1", 1000) != SUCCESS) {
         printf("[ERROR] Failed to set to non-echo mode\n\r");
         //return false;
     }
+    // do this twice because the module response doesnt seem to always take
+    while (sendBasicCommand("set uart mode 1", 1000) != SUCCESS) {
+        printf("[ERROR] Failed to set to non-echo mode\n\r");
+        //return false;
+    }
 
     //Set device to manual infrastructure mode
     if (sendBasicCommand("set wlan join 0", 1000) != SUCCESS) {
@@ -157,7 +158,7 @@
 
 void Wifi::disconnect()
 {
-    wait(2.0f);
+    wait(5.0f);
     printf("[DEBUG] Disconnecting from network\r\n");
 
     if(socketOpened) {