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.
Diff: WNCInterface.h
- Revision:
- 7:fded23f50479
- Parent:
- 6:7cda15f762fe
- Child:
- 8:4b38bfb1704d
--- a/WNCInterface.h Wed Sep 28 00:17:57 2016 +0000
+++ b/WNCInterface.h Thu Oct 06 21:17:18 2016 +0000
@@ -25,6 +25,8 @@
#include <stddef.h>
#include "WncControllerK64F/WncControllerK64F.h"
+#include "WncControllerK64F/WncController/WncController.h"
+#include <Mutex.h>
#ifndef _WNCINTERFACE_H_
#define _WNCINTERFACE_H_
@@ -56,6 +58,7 @@
#define INTSTR(x) TOSTR(x)
#define FATAL_STR __FILE__ ":" INTSTR(__LINE__)
+
#if RESETON_FE == 1
#define MCURESET ((*((volatile unsigned long *)0xE000ED0CU))=(unsigned long)((0x5fa<<16) | 0x04L))
#define RSTMSG "RESET MCU! "
@@ -65,7 +68,7 @@
#endif
#if DISPLAY_FE == 1
-#define PFE printf(RSTMSG "WNC FAILED @ %s\r\n", FATAL_STR)
+#define PFE {extern MODSERIAL *_dbgout;if(_dbgout)_dbgout->printf(RSTMSG "WNC FAILED @ %s\r\n", FATAL_STR);}
#else
#define PFE
#endif
@@ -76,6 +79,9 @@
#define FATAL_WNC_ERROR(v) {extern char *_fatal_err_loc;_fatal_err_loc=FATAL_STR;PFE;DORET(v);}
#endif
+#define M_LOCK WNCInterface::WNCLock->lock()
+#define M_ULOCK WNCInterface::WNCLock->unlock()
+
// Because the WncController has intermixed socket & interface functionallity
// will need to make the Socket class a friend of the Interface class. This
// will allow the Socket class to get to the WNC functions needed for the
@@ -85,6 +91,7 @@
class Endpoint;
class UDPSocket;
class TCPSocketConnection;
+class WNCSms;
class WNCInterface
{
@@ -93,6 +100,7 @@
friend class UDPSocket;
friend class Endpoint;
friend class Socket;
+ friend class WNCSms;
public:
/** Create WNC Data Module Interface Instance for the device (M14A2A) */
@@ -139,11 +147,14 @@
* \return nothing.
*/
void doDebug(int val); //doing this so I can get to the wnc controller pointer
-
+
+
private:
static WncController_fk::WncIpStats myNetStats; //maintaint the network statistics
static WncControllerK64F_fk::WncControllerK64F *_pwnc; //pointer to the WncController instance
+ static Mutex *WNCLock;
static string mac;
+
};
#endif /* _WNCINTERFACE_ */

