Kojto CC3000 Hostdriver With Mbed Socket interface

Dependents:   WiFiDip-KitchenSink WiFiDip-UsbKitchenSink WiFiDipCortexSensor WifiDipCortex-UDPDemo

Fork of cc3000_hostdriver_mbedsocket by Martin Kojtal

Revision:
15:1c2a856c618a
Parent:
11:5e3771b29385
Child:
16:f3676ae62f96
--- a/cc3000.cpp	Tue Oct 01 21:17:44 2013 +0000
+++ b/cc3000.cpp	Wed Oct 02 17:02:34 2013 +0200
@@ -134,7 +134,7 @@
     _wlan.smart_config_start(0);
 
 #if (CC3000_DEBUG == 1)
-        printf("DEBUG: Waiting for smartconfig to be completed.\n");
+        printf("DEBUG: Waiting for smartconfig to be completed. \r\n");
 #endif
     // Wait for Smart config finished
     while (_status.smart_config_complete == 0)
@@ -143,7 +143,7 @@
 
     }
 #if (CC3000_DEBUG == 1)
-        printf("DEBUG: Smartconfig finished.\n");
+        printf("DEBUG: Smartconfig finished.\r\n");
 #endif
 #ifndef CC3000_UNENCRYPTED_SMART_CONFIG
     // create new entry for AES encryption key
@@ -206,7 +206,7 @@
         if (t.read_ms() > 10000){
             ret = false;
 #if (CC3000_DEBUG == 1)
-            printf("Connection to AP failed.\n");
+            printf("Connection to AP failed.\r\n");
 #endif
             break;
         }
@@ -290,7 +290,7 @@
     tcp_socket = _socket.socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
     if (tcp_socket == -1) {
 #if (CC3000_DEBUG == 1)
-        printf("DEBUG: Failed to create new socket (tcp).\n");
+        printf("DEBUG: Failed to create new socket (tcp).\r\n");
 #endif
         return cc3000_client(*this);
     }
@@ -305,7 +305,7 @@
 
     if (_socket.connect(tcp_socket, &socket_address, sizeof(socket_address)) == -1) {
 #if (CC3000_DEBUG == 1)
-        printf("DEBUG: Failed to connect (tcp).\n");
+        printf("DEBUG: Failed to connect (tcp).\r\n");
 #endif
         _socket.closesocket(tcp_socket);
         return cc3000_client(*this);
@@ -320,7 +320,7 @@
     udp_socket = _socket.socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
     if (udp_socket == -1) {
 #if (CC3000_DEBUG == 1)
-        printf("DEBUG: Failed to create new socket (udp).\n");
+        printf("DEBUG: Failed to create new socket (udp).\r\n");
 #endif
         return cc3000_client(*this);
     }
@@ -335,7 +335,7 @@
 
     if (_socket.connect(udp_socket, &socket_address, sizeof(socket_address)) == -1) {
 #if (CC3000_DEBUG == 1)
-        printf("DEBUG: Failed to connect (udp).\n");
+        printf("DEBUG: Failed to connect (udp).\r\n");
 #endif
         _socket.closesocket(udp_socket);
         return cc3000_client(*this);
@@ -351,7 +351,7 @@
     tcp_socket = _socket.socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
     if (tcp_socket == -1) {
 #if (CC3000_DEBUG == 1)
-        printf("Failed to create new socket.\n");
+        printf("Failed to create new socket.\r\n");
 #endif
         return cc3000_server(*this, socket_address);
     }
@@ -366,13 +366,13 @@
 
     if (_socket.bind(tcp_socket, &socket_address, sizeof(socket_address)) != 0) {
 #if (CC3000_DEBUG == 1)
-        printf("DEBUG: Failed to bind the new socket.\n");
+        printf("DEBUG: Failed to bind the new socket.\r\n");
 #endif
         return cc3000_server(*this, socket_address);
     }
     if (_socket.listen(tcp_socket, 1) != 0) { /* 1 client */
 #if (CC3000_DEBUG == 1)
-        printf("DEBUG: Failed to listen on the new socket.\n");
+        printf("DEBUG: Failed to listen on the new socket.\r\n");
 #endif
         return cc3000_server(*this, socket_address);
     }
@@ -409,7 +409,7 @@
     _ping_report.packets_received = 0;
     if (_netapp.ping_send(&reversed_ip, attempts, size, timeout) == -1) {
 #if (CC3000_DEBUG == 1)
-        printf("DEBUG: Failed to send ping.\n");
+        printf("DEBUG: Failed to send ping.\r\n");
 #endif
         return 0;
     }