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: WIFI_API_32kRAM WebSocketClient mbed
Diff: main.cpp
- Revision:
- 1:610f3dc5679e
- Parent:
- 0:47ec083185d0
--- a/main.cpp Wed Oct 07 05:16:10 2015 +0000
+++ b/main.cpp Tue Oct 27 10:03:33 2015 +0000
@@ -8,7 +8,7 @@
Serial pc(USBTX, USBRX);
int main() {
- char recv[30];
+ char recv[50];
pc.baud(115200);
pc.printf("Init...\n");
@@ -17,17 +17,20 @@
eth.init(); //Use DHCP
// set given SSID and PW as the highest priority
- wifi.setNetwork("Tsungta_iPhone", "icq87001", 0);
+ //wifi.setNetwork("Tsungta_iPhone", "icq87001", 0);
+ wifi.setNetwork("GainSpan_JS", "Delta9999", 0);
eth.connect(40000);
pc.printf("IP Address:%s\n",eth.getIPAddress());
pc.printf("MAC Address:%s\n",eth.getMACAddress());
- Websocket ws("ws://172.20.10.11:8888/ws");
+ Websocket ws("ws://192.168.15.105:8888/ws");
ws.connect();
while (1) {
ws.send("WebSocket Hello World over Ethernet");
- wait(1.0);
+ ws.read(recv);
+ pc.printf("read: %s\n", recv);
+ wait(1.0);
}
}
\ No newline at end of file