cc3000 hostdriver with the mbed socket interface

Dependents:   cc3000_hello_world_demo cc3000_simple_socket_demo cc3000_ntp_demo cc3000_ping_demo ... more

Files at this revision

API Documentation at this revision

Comitter:
frankvnk
Date:
Sat Feb 28 16:40:39 2015 +0000
Parent:
47:a63fe1a4f568
Commit message:
Have TCPSocketServer::accept return the real accept values as defined in http://processors.wiki.ti.com/index.php/Non_blocking_accept; Fixed cc3000::init(const char *ip, const char *mask, const char *gateway) - missing _wlan.start(0);

Changed in this revision

Socket/TCPSocketServer.cpp Show annotated file Show diff for this revision Revisions of this file
cc3000.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r a63fe1a4f568 -r 192e2fde71e9 Socket/TCPSocketServer.cpp
--- a/Socket/TCPSocketServer.cpp	Tue Jan 20 09:04:49 2015 +0000
+++ b/Socket/TCPSocketServer.cpp	Sat Feb 28 16:40:39 2015 +0000
@@ -73,7 +73,7 @@
     socklen_t newSockRemoteHostLen = sizeof(connection._remote_host);
     int fd = _cc3000_module->_socket.accept(_sock_fd, (sockaddr *) &connection._remote_host, &newSockRemoteHostLen);
     if (fd < 0) {
-        return -1;
+        return fd;
     }
     /* s_addr is returned in the little endian */
     connection._remote_host.sin_addr.s_addr = htonl(connection._remote_host.sin_addr.s_addr);
diff -r a63fe1a4f568 -r 192e2fde71e9 cc3000.cpp
--- a/cc3000.cpp	Tue Jan 20 09:04:49 2015 +0000
+++ b/cc3000.cpp	Sat Feb 28 16:40:39 2015 +0000
@@ -99,6 +99,7 @@
 }
 
 void cc3000::init(const char *ip, const char *mask, const char *gateway) {
+    _wlan.start(0);
     _netapp.dhcp((uint32_t *)ip, (uint32_t *)mask, (uint32_t *)gateway, (uint32_t *)ip); //dns = ip
     _wlan.stop();
     wait(1);