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: LSM9DS1_Library_cal Servo mbed-rtos mbed
Fork of Websocket_Ethernet_HelloWorld by
Diff: main.cpp
- Revision:
- 1:1c1802ec42a2
- Parent:
- 0:1b0dc7de9db7
- Child:
- 3:20d8657930b6
--- a/main.cpp Fri Aug 10 11:15:53 2012 +0000
+++ b/main.cpp Fri Aug 17 16:20:13 2012 +0000
@@ -1,26 +1,21 @@
-#include "mbed.h"
-#include "EthernetInterface.h"
-#include "Websocket.h"
-
-
-int main() {
- char recv[30];
-
- EthernetInterface eth;
- eth.init(); //Use DHCP
- eth.connect();
- printf("IP Address is %s\n\r", eth.getIPAddress());
-
- Websocket ws("ws://sockets.mbed.org:443/ws/demo/rw");
- ws.connect();
-
- while (1) {
- int res = ws.send("WebSocket Hello World!");
-
- if (ws.read(recv)) {
- printf("rcv: %s\r\n", recv);
- }
-
- wait(0.1);
- }
-}
+#include "mbed.h"
+#include "EthernetInterface.h"
+#include "Websocket.h"
+
+
+int main() {
+ char recv[30];
+
+ EthernetInterface eth;
+ eth.init(); //Use DHCP
+ eth.connect();
+ printf("IP Address is %s\n\r", eth.getIPAddress());
+
+ Websocket ws("ws://sockets.mbed.org:443/ws/demo/wo");
+ ws.connect();
+
+ while (1) {
+ ws.send("WebSocket Hello World over Ethernet");
+ wait(1.0);
+ }
+}
\ No newline at end of file
