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:
Sat Sep 10 02:32:47 2016 +0000
Parent:
14:e846217affcd
Child:
16:f748245382ac
Commit message:
Added 2 socket open methods (public) to open with a url c-string or ip address c-string.

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	Sat Sep 10 02:02:05 2016 +0000
+++ b/WncController.cpp	Sat Sep 10 02:32:47 2016 +0000
@@ -336,6 +336,23 @@
  *
  *  \details None.
  */
+ 
+bool WncController::openSocketUrl(uint16_t numSock, const char * url, uint16_t port, bool tcp, uint16_t timeOutSec)
+{
+    if (resolveUrl(numSock, url) == true)
+        return (openSocket(numSock, port, tcp, timeOutSec));
+    
+    return (false);
+}
+
+bool WncController::openSocketIpAddr(uint16_t numSock, const char * ipAddr, uint16_t port, bool tcp, uint16_t timeOutSec)
+{
+    if (setIpAddr(numSock, ipAddr) == true)
+        return (openSocket(numSock, port, tcp, timeOutSec));
+    
+    return (false);
+}
+ 
 bool WncController::openSocket(uint16_t numSock, uint16_t port, bool tcp, uint16_t timeOutSec)
 {
     if (numSock < MAX_NUM_WNC_SOCKETS) {
--- a/WncController.h	Sat Sep 10 02:02:05 2016 +0000
+++ b/WncController.h	Sat Sep 10 02:32:47 2016 +0000
@@ -195,6 +195,11 @@
      *  \details None.
      */
     bool openSocket(uint16_t numSock, uint16_t port, bool tcp, uint16_t timeOutSec = 30);
+    
+    bool openSocketUrl(uint16_t numSock, const char * url, uint16_t port, bool tcp, uint16_t timeOutSec = 30);
+
+    bool openSocketIpAddr(uint16_t numSock, const char * ipAddr, uint16_t port, bool tcp, uint16_t timeOutSec = 30);
+
 
     /**
      *  \brief Write bytes of data to an open socket