WNCInterface

Dependencies:   WncControllerK64F

Fork of WNCInterface by Avnet

Revision:
9:9f0578ff157a
Parent:
1:e511ea8d39d5
Child:
18:198e9b0acf11
--- a/Socket/UDPSocket.cpp	Fri Oct 07 00:36:47 2016 +0000
+++ b/Socket/UDPSocket.cpp	Fri Oct 07 13:26:00 2016 +0000
@@ -50,9 +50,7 @@
 int UDPSocket::sendTo(Endpoint &remote, char *packet, int length) {
     int ret = -1;
     
-    if( WNCInterface::_pwnc->getWncStatus() == FATAL_FLAG )
-        FATAL_WNC_ERROR(fail);
- 
+    CHK_WNCFE(( WNCInterface::_pwnc->getWncStatus() == FATAL_FLAG ), fail);
     if( remote._epAddr.port ) {  //make sure the Endpoint has an port assoicated with it
         if( Socket::connect(remote._epAddr.IP,SOCK_DGRAM,remote._epAddr.port) ) {
             if( WNCInterface::_pwnc->write(0,packet,length) )
@@ -71,9 +69,7 @@
     _is_blocking = blocking;   // true or false
     _btimeout = timeout;       // user specifies in msec
  
-    if( WNCInterface::_pwnc->getWncStatus() == FATAL_FLAG )
-        FATAL_WNC_ERROR(void);
- 
+    CHK_WNCFE(( WNCInterface::_pwnc->getWncStatus() == FATAL_FLAG ), void);
     WNCInterface::_pwnc->setReadRetryWait(0, 0);
     WNCInterface::_pwnc->setReadRetries(0, 0);
 }
@@ -88,9 +84,7 @@
     if( !remote._epAddr.port )
       return -1;
 
-    if( WNCInterface::_pwnc->getWncStatus() == FATAL_FLAG )
-        FATAL_WNC_ERROR(fail);
- 
+    CHK_WNCFE(( WNCInterface::_pwnc->getWncStatus() == FATAL_FLAG ), fail);
     ret = Socket::connect(remote._epAddr.IP,SOCK_DGRAM,remote._epAddr.port);        
     
     t.start();