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

Fork of WncControllerLibrary by Fred Kellerman

Revision:
13:73629a6e9122
Parent:
12:33290e9e6e5f
Child:
14:e846217affcd
--- a/WncController.cpp	Sat Sep 10 00:49:34 2016 +0000
+++ b/WncController.cpp	Sat Sep 10 01:10:20 2016 +0000
@@ -392,7 +392,7 @@
  *  arriving at the endpoint.
  */
  
-bool WncController::sockWrite(const char * const s, uint32_t n, uint16_t numSock, bool isTcp)
+bool WncController::sockWrite(const char * const s, uint16_t n, uint16_t numSock, bool isTcp)
 {
     bool result = true;
     
@@ -422,7 +422,7 @@
             }
             else {
                 uint16_t rem = n % MAX_WNC_WRITE_BYTES;
-                while (n > MAX_WNC_WRITE_BYTES) {
+                while (n >= MAX_WNC_WRITE_BYTES) {
                     n -= MAX_WNC_WRITE_BYTES;
                     result = sockWrite(s, MAX_WNC_WRITE_BYTES, numSock, m_sSock[numSock].isTcp);
                     if (result == false) {
@@ -1422,7 +1422,7 @@
     return (false);
 }
 
-WncController::AtCmdErr_e WncController::at_sockwrite_wnc(const char * s, uint32_t n, uint16_t numSock, bool isTcp)
+WncController::AtCmdErr_e WncController::at_sockwrite_wnc(const char * s, uint16_t n, uint16_t numSock, bool isTcp)
 {
     AtCmdErr_e result;
 
@@ -1444,7 +1444,7 @@
             n--;
             num2str = _to_hex_string((uint8_t)*s++);
             // Always 2-digit ascii hex:
-            if (strlen(num2str) == 1)
+            if (num2str[1] == '\0')
                 cmd_str += '0';
             cmd_str += num2str;
         }