Remote I/O Sensor bus with AT&T flow and M2X cloud

Dependencies:   DHT11 FXOS8700CQ MODSERIAL mbed

Fork of Avnet_ATT_Cellular_IOT by Avnet

Revision:
39:1996eaec02d6
Parent:
38:564b312a719f
Child:
40:aec4d09fde23
--- a/wnc_control.cpp	Sat Jul 23 04:27:35 2016 +0000
+++ b/wnc_control.cpp	Sat Jul 23 14:58:03 2016 +0000
@@ -31,8 +31,8 @@
   {
     WNC_MDM_ERR = WNC_OK;
     at_init_wnc();
-    if (WNC_MDM_ERR == WNC_NO_RESPONSE)
-      reinitialize_mdm();
+    //if (WNC_MDM_ERR == WNC_NO_RESPONSE)
+    //  reinitialize_mdm();
   } while (WNC_MDM_ERR != WNC_OK); 
 }
 
@@ -44,7 +44,7 @@
       at_dnsresolve_wnc(MY_SERVER_URL, &MyServerIpAddress);
       if (WNC_MDM_ERR == WNC_NO_RESPONSE)
       {
-        reinitialize_mdm();
+      //  reinitialize_mdm();
         software_init_mdm();
       }
       else if (WNC_MDM_ERR == WNC_CMD_ERR)
@@ -68,7 +68,7 @@
       at_sockopen_wnc(MyServerIpAddress, MY_PORT_STR);
       if (WNC_MDM_ERR == WNC_NO_RESPONSE)
       {
-        reinitialize_mdm();
+        // reinitialize_mdm();
         software_init_mdm();
       }
       else if (WNC_MDM_ERR == WNC_CMD_ERR)
@@ -88,14 +88,14 @@
       at_sockwrite_wnc(s);
       if (WNC_MDM_ERR == WNC_NO_RESPONSE)
       {
-        reinitialize_mdm();
+        // reinitialize_mdm();
         software_init_mdm();
       }
       else if (WNC_MDM_ERR == WNC_CMD_ERR)
       {
         pc.puts("Socket Write fail!!!\r\n");
         // Have seen when write fails modem gets stuck in bad state, try to recover
-        reinitialize_mdm();
+        // reinitialize_mdm();
         software_init_mdm();
       }
     } while (WNC_MDM_ERR != WNC_OK);
@@ -121,7 +121,7 @@
       {
         if (n == 0)
         {
-            reinitialize_mdm();
+           // reinitialize_mdm();
             software_init_mdm();
         }
         else
@@ -149,7 +149,7 @@
       socketOpen = 0;
       if (WNC_MDM_ERR == WNC_NO_RESPONSE)
       {
-        reinitialize_mdm();
+        // reinitialize_mdm();
         software_init_mdm();
       }
       else if (WNC_MDM_ERR == WNC_CMD_ERR)
@@ -283,7 +283,7 @@
   cmd_str += "\",";
   cmd_str += port;
   cmd_str += ",30";
-  send_wnc_cmd(cmd_str.c_str(), &pRespStr, 30000);
+  send_wnc_cmd(cmd_str.c_str(), &pRespStr, 31000);
   send_wnc_cmd("AT@SOCKCREAT?", &pRespStr, WNC_TIMEOUT_MS);
   send_wnc_cmd("AT@SOCKCONN?", &pRespStr, WNC_TIMEOUT_MS);
 }
@@ -334,7 +334,7 @@
   string * pRespStr;
   char num2str[6];
   size_t sLen = strlen(s);
-  if (sLen <= 99999)
+  if (sLen <= 1500)
   {
     string cmd_str("AT@SOCKWRITE=1,");
     itoa(sLen, num2str, 10);
@@ -353,7 +353,7 @@
       cmd_str += num2str;
     }
     cmd_str += "\"";
-    send_wnc_cmd(cmd_str.c_str(), &pRespStr, WNC_TIMEOUT_MS);
+    send_wnc_cmd(cmd_str.c_str(), &pRespStr, 31000);
   }
   else
     pc.puts("sockwrite Err, string to long\r\n");