cc3000 tcp server demo (please check mbed socket interface for python script to test this demo) mbed.org/handbook/Socket
Dependencies: NVIC_set_all_priorities cc3000_hostdriver_mbedsocket mbed
Diff: main.cpp
- Revision:
- 1:ea2af255043f
- Parent:
- 0:1cadde6a47e3
- Child:
- 3:3f53082b16ec
diff -r 1cadde6a47e3 -r ea2af255043f main.cpp
--- a/main.cpp Thu Sep 26 20:08:38 2013 +0000
+++ b/main.cpp Thu Sep 26 20:09:32 2013 +0000
@@ -158,24 +158,7 @@
wigo.get_ip_config(&ipinfo2); // data is returned in the ipinfo2 structure
printf("\n*** Wi-Go board DHCP assigned IP Address = %d.%d.%d.%d\n", ipinfo2.aucIP[3], ipinfo2.aucIP[2], ipinfo2.aucIP[1], ipinfo2.aucIP[0]);
- const char* ECHO_SERVER_ADDRESS = "192.168.1.10";
const int ECHO_SERVER_PORT = 1895;
-
-// TCPSocketConnection socket;
-// while (socket.connect(ECHO_SERVER_ADDRESS, ECHO_SERVER_PORT) < 0) {
-// printf("Unable to connect to (%s) on port (%d)\n", ECHO_SERVER_ADDRESS, ECHO_SERVER_PORT);
-// wait(1);
-// }
-//
-// char hello[] = "Hello World\n";
-// socket.send_all(hello, sizeof(hello) - 1);
-//
-// char buf[256];
-// int n = socket.receive(buf, 256);
-// buf[n] = '\0';
-// printf("%s", buf);
-//
-// socket.close();
TCPSocketServer server;
server.bind(ECHO_SERVER_PORT);
@@ -199,8 +182,5 @@
client.close();
}
-
-
- wigo.disconnect();
}