cc3000 hostdriver with the mbed socket interface

Dependents:   cc3000_hello_world_demo cc3000_simple_socket_demo cc3000_ntp_demo cc3000_ping_demo ... more

Revision:
16:f3676ae62f96
Parent:
13:5e36c267e62f
Parent:
12:1c2a856c618a
Child:
28:8c7cc1c76ff8
--- a/Socket/UDPSocket.cpp	Wed Oct 02 15:29:26 2013 +0000
+++ b/Socket/UDPSocket.cpp	Wed Oct 02 16:00:41 2013 +0000
@@ -57,15 +57,13 @@
         return -1;
     }
 
-//    if (!_blocking) {
-//        TimeInterval timeout(_timeout);
-//        if (wait_writable(timeout) != 0) {
-//#if (CC3000_DEBUG == 1)
-//            printf("DEBUG: The socket is not writeable. _sock_fd: %d.\n", _sock_fd);
-//#endif
-//            return 0;
-//        }
-//    }
+    if (!_blocking) {
+        TimeInterval timeout(_timeout);
+        if (wait_writable(timeout) != 0) {
+            DBG_SOCKET("The socket is not writeable. _sock_fd: %d", _sock_fd);
+            return 0;
+        }
+    }
 
     return _cc3000_module->_socket.sendto(_sock_fd, packet, length, 0, (sockaddr *)&remote._remote_host, sizeof(sockaddr));
 }