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.

Revision:
9:9f0578ff157a
Parent:
7:fded23f50479
--- a/Sms/IOTSMS.cpp	Fri Oct 07 00:36:47 2016 +0000
+++ b/Sms/IOTSMS.cpp	Fri Oct 07 13:26:00 2016 +0000
@@ -52,8 +52,7 @@
   //not completing our tasks wihin the timeperiod.  So stop the timer when
   //we come in and start it when we leave.
   //
-  if( WNCInterface::_pwnc->getWncStatus() == FATAL_FLAG )
-    FATAL_WNC_ERROR(void);
+  CHK_WNCFE(( WNCInterface::_pwnc->getWncStatus() == FATAL_FLAG ), void);
     
   m_SMStimer->stop();  //stop the timer while we check for SMS messages
   M_LOCK;       
@@ -87,8 +86,7 @@
 //
 int WNCSms::init(uint32_t p, void (*cb)(WNCSmsMsg& s)) {
 
-  if( WNCInterface::_pwnc->getWncStatus() == FATAL_FLAG )
-    FATAL_WNC_ERROR(fail);
+  CHK_WNCFE(( WNCInterface::_pwnc->getWncStatus() == FATAL_FLAG ), fail);
   
   if( WNCInterface::_pwnc == NULL )  //must have already initialized WNCInterface
     return -1;
@@ -139,8 +137,7 @@
   if( !m_smsinit )
     return -1;
 
-  if( WNCInterface::_pwnc->getWncStatus() == FATAL_FLAG )
-    FATAL_WNC_ERROR(fail);
+  CHK_WNCFE(( WNCInterface::_pwnc->getWncStatus() == FATAL_FLAG ), fail);
   M_LOCK;
   int ret = WNCInterface::_pwnc->readUnreadSMSText(&m_smsmsgs, true);
   M_ULOCK;
@@ -153,19 +150,14 @@
     string iccid_str;
     static string msisdn_str;
     
-    if( WNCInterface::_pwnc->getWncStatus() == FATAL_FLAG )
-      FATAL_WNC_ERROR(null);
-
+    CHK_WNCFE(( WNCInterface::_pwnc->getWncStatus() == FATAL_FLAG ), null);
     M_LOCK;
     if( !WNCInterface::_pwnc->getICCID(&iccid_str) ) {
        M_ULOCK;
        return NULL;
        }
       
-    if( WNCInterface::_pwnc->getWncStatus() == FATAL_FLAG ) {
-       M_ULOCK;
-       FATAL_WNC_ERROR(null);
-       }
+    CHK_WNCFE(( WNCInterface::_pwnc->getWncStatus() == FATAL_FLAG ), null);
 
     if( WNCInterface::_pwnc->convertICCIDtoMSISDN(iccid_str, &msisdn_str) )
         ret = (char*)msisdn_str.c_str();