This library controls the WNC. There is a derived class for usage from the K64F board.

Fork of WncControllerLibrary by Fred Kellerman

Files at this revision

API Documentation at this revision

Comitter:
fkellermavnet
Date:
Fri Oct 07 18:36:42 2016 +0000
Parent:
30:98c9ff850c1b
Child:
32:6512f41ac6f0
Commit message:
Added a toggle of the wakeup pin to try to stop the 'A' from being dropped.; Added an AT% cmd to turn off power saving mode, this is thought to maybe be a solution to the no response problem.;

Changed in this revision

WncController.cpp Show annotated file Show diff for this revision Revisions of this file
WncController.h Show annotated file Show diff for this revision Revisions of this file
--- a/WncController.cpp	Fri Sep 23 14:55:35 2016 +0000
+++ b/WncController.cpp	Fri Oct 07 18:36:42 2016 +0000
@@ -1582,10 +1582,22 @@
     return (WNC_AT_CMD_OK == at_send_wnc_cmd("AT", &pRespStr, WNC_QUICK_CMD_TIMEOUT_MS)); // Heartbeat?
 }
 
+bool WncController::at_power_save_off_wnc(void)
+{
+    string *pRespStr;
+    AtCmdErr_e cmdRes = at_send_wnc_cmd("AT%SETCFG=\"pw_nosrvc\",\"none\"", &pRespStr, m_sCmdTimeoutMs);
+    
+    if (cmdRes == WNC_AT_CMD_OK)
+        return (true);
+    else
+        return (false);
+}
+
 bool WncController::at_init_wnc(bool hardReset)
 {
   string * pRespStr;
   AtCmdErr_e cmdRes;
+  static bool pwrSaveOnce = false;
   
   if (hardReset == true)
       dbgPuts("Hard Soft Reset!");
@@ -1610,6 +1622,13 @@
 
   cmdRes = at_send_wnc_cmd("AT", &pRespStr, WNC_QUICK_CMD_TIMEOUT_MS);     // Heartbeat?
   
+  // Altera suggests turning off power save mode and only do it 1 time!
+  if (pwrSaveOnce == false) {
+      dbgPuts("Power Saving Mode OFF!");
+      pwrSaveOnce = true;
+      at_power_save_off_wnc();
+  }    
+  
   // If the simple commands are not working, no chance of more complex.
   //  I have seen re-trying commands make it worse.
   if (cmdRes != WNC_AT_CMD_OK)
--- a/WncController.h	Fri Sep 23 14:55:35 2016 +0000
+++ b/WncController.h	Fri Oct 07 18:36:42 2016 +0000
@@ -404,7 +404,8 @@
     bool at_gettimedate_wnc(struct WncDateTime * tod);
     bool at_ping_wnc(const char * ip);
     bool at_geticcid_wnc(string * iccid);
-
+    bool at_power_save_off_wnc(void);
+    
     // Utility methods
     void sendCmd(const char * cmd, bool crLf);
     void sendCmd(const char * cmd, unsigned n, unsigned wait_uS, bool crLf);