FRDM-K64F, Avnet M14A2A, Grove Shield, to create smart home system. In use with AT&Ts M2x & Flow.

Dependencies:   mbed FXOS8700CQ MODSERIAL

Files at this revision

API Documentation at this revision

Comitter:
fkellermavnet
Date:
Sat Jul 23 20:13:01 2016 +0000
Parent:
39:1996eaec02d6
Child:
41:9b14c40eebf6
Child:
42:be4b9ee3a615
Commit message:
Turned back on hardware init. Without it really stops responding completely. Hardware init does not always make it work but it seems to sometimes and so is better without it. YMMV. Still have not found the root cause of WNC no response.

Changed in this revision

wnc_control.cpp Show annotated file Show diff for this revision Revisions of this file
wnc_control.h Show annotated file Show diff for this revision Revisions of this file
--- a/wnc_control.cpp	Sat Jul 23 14:58:03 2016 +0000
+++ b/wnc_control.cpp	Sat Jul 23 20:13:01 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)
--- a/wnc_control.h	Sat Jul 23 14:58:03 2016 +0000
+++ b/wnc_control.h	Sat Jul 23 20:13:01 2016 +0000
@@ -2,7 +2,7 @@
 #ifndef __WNC_CONTROL_H_
 #define __WNC_CONTROL_H_
 
-static const unsigned WNC_TIMEOUT_MS = 5000;
+static const unsigned WNC_TIMEOUT_MS = 10000;
 
 // Core function that sends data to the WNC UART
 extern int send_wnc_cmd(const char * s, string ** r, int ms_timeout);