This is first release for WebSocket Client example using WizFi250
Dependencies: WebSocketClient WizFi250Interface mbed
This example is WebSocket Client using WizFi250 Wi-Fi module on mbed platform ( KL-25Z or LPC1768 ).
About Websocket
Getting Started with Websockets
Pinout
For using KL-25Z
Description | WizFi250 | KL-25Z | |
VCC | JP4 : 5V | 5V | |
GND | JP4 :GND | GND | |
TXD-RXD | JP2: TXD | PTE1 | |
RXD-TXD | JP2: RXD | PTE0 | |
Reset | JP10:pin2 | PTD4 |
For using LPC1768
Revision 0:97037d9415b8, committed 2014-11-14
- Comitter:
- kaizen
- Date:
- Fri Nov 14 08:18:59 2014 +0000
- Commit message:
- This is first commit for WebSocket_WizFi250_HelloWorld
Changed in this revision
diff -r 000000000000 -r 97037d9415b8 WebSocketClient.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/WebSocketClient.lib Fri Nov 14 08:18:59 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/samux/code/WebSocketClient/#4567996414a5
diff -r 000000000000 -r 97037d9415b8 WizFi250Interface.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/WizFi250Interface.lib Fri Nov 14 08:18:59 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/kaizen/code/WizFi250Interface/#431172d536ee
diff -r 000000000000 -r 97037d9415b8 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Nov 14 08:18:59 2014 +0000 @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2014 Wiznet, MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software + * and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#include "mbed.h" +#include "WizFi250Interface.h" +#include "Websocket.h" + +#define SECURE WizFi250::SEC_AUTO +#define SSID "YOUR-SSID" +#define PASS "YOUR-PASSWORD" + +#if defined(TARGET_LPC1768) + #define _TXD p28 + #define _RXD p27 + #define _RTS NC + #define _CTS NC + #define _RESET p21 + #define _BAUD 115200 +#elif defined(TARGET_KL25Z) + #define _TXD PTE0 + #define _RXD PTE1 + #define _RTS NC + #define _CTS NC + #define _RESET PTD4 + #define _BAUD 115200 +#endif + +Serial pc(USBTX,USBRX); +WizFi250Interface wizfi250(_TXD,_RXD,_RTS,_CTS,_RESET,NC,_BAUD,&pc); + +int main() +{ + printf("Start Application\r\n"); + + wizfi250.init(); + while (wizfi250.connect(SECURE, SSID, PASS)); + printf("IP Address is %s\r\n", wizfi250.getIPAddress()); + + Websocket ws("ws://sockets.mbed.org:443/ws/kaizen/wo"); + while (!ws.connect()); + + while(1) + { + printf("Send:Websocket Hello World over WizFi250\r\n"); + ws.send("Websocket Hello World over WizFi250"); + wait(1.0); + } +} \ No newline at end of file
diff -r 000000000000 -r 97037d9415b8 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Nov 14 08:18:59 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/031413cf7a89 \ No newline at end of file