The WDCInterface is is a drop-in replacement for an EthernetInterface class that allows the user to connect to the Internet with a Wistron NeWeb Corporation (WNC) M14A2A Series data module using the standard network Socket API's. This interface class is used in the AT&T Cellular IoT Starter Kit which is sold by Avnet (http://cloudconnectkits.org/product/att-cellular-iot-starter-kit).

Dependencies:   WncControllerK64F

Dependents:   WNCProximityMqtt Pubnub_ATT_IoT_SK_WNC_sync BluemixDemo BluemixQS ... more

See the WNCInterface README in the Wiki tab for detailed information on this library.

Files at this revision

API Documentation at this revision

Comitter:
JMF
Date:
Fri Mar 24 21:50:50 2017 +0000
Parent:
26:81e520908460
Child:
28:dceb8da78e6d
Commit message:
Updating Class EndPoint to WncEndpoint

Changed in this revision

Socket/WncEndpoint.cpp Show annotated file Show diff for this revision Revisions of this file
Socket/WncEndpoint.h Show annotated file Show diff for this revision Revisions of this file
Socket/WncTCPSocketConnection.h Show annotated file Show diff for this revision Revisions of this file
Socket/WncUDPSocket.cpp Show annotated file Show diff for this revision Revisions of this file
Socket/WncUDPSocket.h Show annotated file Show diff for this revision Revisions of this file
WNCInterface.h Show annotated file Show diff for this revision Revisions of this file
--- a/Socket/WncEndpoint.cpp	Fri Mar 24 21:43:57 2017 +0000
+++ b/Socket/WncEndpoint.cpp	Fri Mar 24 21:50:50 2017 +0000
@@ -26,13 +26,13 @@
 #include "WncSocket.h"
 #include "WncEndpoint.h"
 
-Endpoint::Endpoint()  {
+WncEndpoint::WncEndpoint()  {
     reset_address();
 }
 
-Endpoint::~Endpoint() {}
+WncEndpoint::~WncEndpoint() {}
 
-void Endpoint::reset_address(void) {
+void WncEndpoint::reset_address(void) {
     std::memset(&_epAddr, 0, sizeof(struct EndPointAddr));
 }
 
@@ -42,7 +42,7 @@
 // address.
 //
 
-int Endpoint::set_address(const char* host, const int port) {
+int WncEndpoint::set_address(const char* host, const int port) {
      // IP Address
     char address[5];
     int rslt;
@@ -68,11 +68,11 @@
     return rslt;
 }
 
-char* Endpoint::get_address() {
+char* WncEndpoint::get_address() {
     return _epAddr.IP;
 }
 
-int   Endpoint::get_port() {
+int   WncEndpoint::get_port() {
     return _epAddr.port;
 }
 
--- a/Socket/WncEndpoint.h	Fri Mar 24 21:43:57 2017 +0000
+++ b/Socket/WncEndpoint.h	Fri Mar 24 21:50:50 2017 +0000
@@ -35,12 +35,12 @@
 
 class UDPSocket;
 
-class Endpoint {
+class WncEndpoint {
     friend class UDPSocket;
 
 public:
-    Endpoint(void);
-    ~Endpoint(void);
+    WncEndpoint(void);
+    ~WncEndpoint(void);
     
     /** Reset the address of the endpoint by clearning the internal endpoint IP address
     \param none
--- a/Socket/WncTCPSocketConnection.h	Fri Mar 24 21:43:57 2017 +0000
+++ b/Socket/WncTCPSocketConnection.h	Fri Mar 24 21:50:50 2017 +0000
@@ -31,7 +31,7 @@
 /**
 TCP socket connection
 */
-class TCPSocketConnection : public Socket, public Endpoint {
+class TCPSocketConnection : public Socket, public WncEndpoint {
     
 public:
     TCPSocketConnection();
--- a/Socket/WncUDPSocket.cpp	Fri Mar 24 21:43:57 2017 +0000
+++ b/Socket/WncUDPSocket.cpp	Fri Mar 24 21:50:50 2017 +0000
@@ -47,7 +47,7 @@
 }
 
 // -1 if unsuccessful, else number of bytes written
-int UDPSocket::sendTo(Endpoint &remote, char *packet, int length) {
+int UDPSocket::sendTo(WncEndpoint &remote, char *packet, int length) {
     int ret = -1;
     
     CHK_WNCFE(( WNCInterface::_pwnc->getWncStatus() == FATAL_FLAG ), fail);
@@ -75,7 +75,7 @@
 }
 
 // -1 if unsuccessful, else number of bytes received
-int UDPSocket::receiveFrom(Endpoint &remote, char *buffer, int length) {
+int UDPSocket::receiveFrom(WncEndpoint &remote, char *buffer, int length) {
     const uint8_t *ptr;
     Timer t;
     int done, ret = -1;
--- a/Socket/WncUDPSocket.h	Fri Mar 24 21:43:57 2017 +0000
+++ b/Socket/WncUDPSocket.h	Fri Mar 24 21:50:50 2017 +0000
@@ -46,7 +46,7 @@
     \param length The length of the buffer to send.
     \return the number of written bytes on success (>=0) or -1 on failure
      */    
-    int sendTo(Endpoint &remote, char *packet, int length);
+    int sendTo(WncEndpoint &remote, char *packet, int length);
 
     /** receiveFrom - receive data from the remote host.
     \param remote, a pointer to the endpoint (class)
@@ -54,7 +54,7 @@
     \param length The maximum length of the buffer.
     \return the number of received bytes on success (>=0) or -1 on failure
      */
-    int receiveFrom(Endpoint &remote, char *buffer, int length);
+    int receiveFrom(WncEndpoint &remote, char *buffer, int length);
 
     /** Set blocking or non-blocking mode of the socket and a timeout 
     \param  blocking true for blocking mode, false for non-blocking mode.
--- a/WNCInterface.h	Fri Mar 24 21:43:57 2017 +0000
+++ b/WNCInterface.h	Fri Mar 24 21:50:50 2017 +0000
@@ -89,7 +89,7 @@
 // socket. Forward reference the class
 
 class Socket;
-class Endpoint;
+class WncEndpoint;
 class UDPSocket;
 class TCPSocketConnection;
 class WNCSms;
@@ -99,7 +99,7 @@
   class WncControllerK64F;  //forward reference the Controller Class
   friend class TCPSocketConnection;
   friend class UDPSocket;
-  friend class Endpoint;
+  friend class WncEndpoint;
   friend class Socket;
   friend class WNCSms;