For lecture
Dependencies: WIZnetInterface mbed WIZwiki-W7500-lecture
Dependents: WIZwiki-W7500-lecture1-tcp WIZwiki-W7500-lecture2-udp WIZwiki-W7500-lecture WIZwiki-W7500-lecture1-tcp-server ... more
Fork of TCPClient_HelloWorld_WIZwiki-W7500 by
Revision 3:6bf1bacd14f5, committed 2016-02-01
- Comitter:
- bangbh
- Date:
- Mon Feb 01 01:22:38 2016 +0000
- Parent:
- 2:ba228e5b659c
- Child:
- 4:09dc56cf66d3
- Commit message:
- For lecture
Changed in this revision
| WIZwiki-W7500-lecture.lib | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/WIZwiki-W7500-lecture.lib Mon Feb 01 01:22:38 2016 +0000 @@ -0,0 +1,1 @@ +https://developer.mbed.org/users/bangbh/code/WIZwiki-W7500-lecture/#ba228e5b659c
--- a/main.cpp Mon Feb 01 00:34:33 2016 +0000
+++ b/main.cpp Mon Feb 01 01:22:38 2016 +0000
@@ -9,30 +9,4 @@
eth.init(mac_addr, "192.168.0.180", "255.255.255.0", "192.168.0.1"); // USE Static IP
//eth.init(mac_addr); //Use DHCP
eth.connect();
-
- printf("IP Address is %s\r\n", eth.getIPAddress());
-
- UDPSocket udp_sock;
- TCPSocketConnection tcp_sock;
- tcp_sock.connect("192.168.0.244", 4545);
- udp_sock.init();
- udp_sock.bind(60001);
- Endpoint udp_server;
- udp_server.set_address("192.168.0.244",4023);
- char http_cmd[] = "GET /data/2.5/weather?q=Seoul,kr HTTP/1.0\n\n";
- tcp_sock.send_all(http_cmd, sizeof(http_cmd)-1);
- udp_sock.sendTo(udp_server,http_cmd,sizeof(http_cmd)-1);
- char buffer[400];
- int ret;
- while (true) {
- ret = tcp_sock.receive(buffer, sizeof(buffer)-1);
- if (ret <= 0) break;
- buffer[ret] = '\0';
- printf("Received %d chars from server: %s\n", ret, buffer);
- }
-
- tcp_sock.close();
-
- eth.disconnect();
-
}
\ No newline at end of file
