Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: NVIC_set_all_priorities cc3000_hostdriver_mbedsocket mbed
Diff: main.cpp
- Revision:
- 1:d9c04472edaf
- Parent:
- 0:ea82b2471444
- Child:
- 2:72ff0379d7b5
--- a/main.cpp Sun Oct 06 10:37:55 2013 +0000
+++ b/main.cpp Sun Oct 06 12:58:16 2013 +0200
@@ -150,23 +150,23 @@
printf("DHCP assigned IP Address = %d.%d.%d.%d \r\n", ipinfo2.aucIP[3], ipinfo2.aucIP[2], ipinfo2.aucIP[1], ipinfo2.aucIP[0]);
const char* ECHO_SERVER_ADDRESS = "192.168.1.5";
- const int ECHO_SERVER_PORT = 7;
+ const int ECHO_SERVER_PORT = 1500;
UDPSocket sock;
sock.init();
-
+
Endpoint echo_server;
echo_server.set_address(ECHO_SERVER_ADDRESS, ECHO_SERVER_PORT);
-
+
char out_buffer[] = "Hello World\n";
sock.sendTo(echo_server, out_buffer, sizeof(out_buffer));
-
+
char in_buffer[256];
int n = sock.receiveFrom(echo_server, in_buffer, sizeof(in_buffer));
-
+
in_buffer[n] = '\0';
printf("%s\n", in_buffer);
-
+
sock.close();
printf("Completed.\n");