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

Fork of WncControllerLibrary by Fred Kellerman

Revision:
31:5db38ccccd1d
Parent:
30:98c9ff850c1b
Child:
32:6512f41ac6f0
--- 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)