WebSocket client library
Diff: Websocket.h
- Revision:
- 13:3b058372cad9
- Parent:
- 12:1f6b9451a608
- Child:
- 16:d4518b50f653
--- a/Websocket.h Fri Aug 26 09:17:30 2011 +0000 +++ b/Websocket.h Tue Aug 30 09:25:28 2011 +0000 @@ -39,9 +39,9 @@ /** Websocket client Class. * - * Warning: you must use a wifi module (Wifly RN131-C) to use this class + * Warning: you must use a wifi module (Wifly RN131-C) or an ethernet network to use this class * - * Example: + * Example (wifi network): * @code * #include "mbed.h" * #include "Wifly.h" @@ -54,7 +54,7 @@ * int main() * { * wifly = new Wifly(p9, p10, p20, "network", "password", true); - * ws = new Websocket("ws://ip_domain/path", 80, wifly); + * ws = new Websocket("ws://ip_domain/path", wifly); * * if(wifly->Join()) * { @@ -75,6 +75,34 @@ * * } * @endcode + * + * + * + * Example (ethernet network): + * @code + * #include "mbed.h" + * #include "Websocket.h" + * + * Serial pc(USBTX, USBRX); + * Websocket * ws; + * + * int main() + * { + * ws = new Websocket("ws://ip_domain/path"); + * + * if(ws->connect()) + * { + * pc.printf("ws connected\r\n"); + * while(1) + * { + * wait(0.1); + * ws->Send("test"); + * } + * } + * else + * pc.printf("ws not connected\r\n"); + * } + * @endcode */ class Websocket {