OK connect Eth View: http://sockets.mbed.org/demo/viewer
Dependencies: EthernetInterface WebSocketClient mbed-rtos mbed
Fork of Websocket_Ethernet_HelloWorld by
Revision 3:9dd9b7afa272, committed 2014-04-27
- Comitter:
- avnisha
- Date:
- Sun Apr 27 06:58:33 2014 +0000
- Parent:
- 2:00da1457c871
- Commit message:
- ok
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed-rtos.lib | Show annotated file Show diff for this revision Revisions of this file |
diff -r 00da1457c871 -r 9dd9b7afa272 main.cpp --- a/main.cpp Thu Aug 23 14:11:49 2012 +0000 +++ b/main.cpp Sun Apr 27 06:58:33 2014 +0000 @@ -4,18 +4,22 @@ int main() { - char recv[30]; + char recv[30]; + int ret; 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"); + Websocket ws("ws://sockets.mbed.org:443/ws/demo/rw"); ws.connect(); while (1) { - ws.send("WebSocket Hello World over Ethernet"); + ret = ws.send("WebSocket Hello World over Ethernet"); + printf("ret = %d\n", ret); + if (ws.read(recv)) + printf("recv: %s\r\n", recv); wait(1.0); } } \ No newline at end of file
diff -r 00da1457c871 -r 9dd9b7afa272 mbed-rtos.lib --- a/mbed-rtos.lib Thu Aug 23 14:11:49 2012 +0000 +++ b/mbed-rtos.lib Sun Apr 27 06:58:33 2014 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed-rtos/#70bd33086f56 +http://mbed.org/users/mbed_official/code/mbed-rtos/#29007aef10a4