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: FINAL_PROJECT_4180 WebSocketClient WiflyInterface mbed-rtos mbed
Fork of Websocket_Wifly_HelloWorld by
main.cpp
- Committer:
- samux
- Date:
- 2012-08-17
- Revision:
- 0:64c683256184
- Child:
- 1:31e50fea8be8
File content as of revision 0:64c683256184:
#include "mbed.h"
#include "WiflyInterface.h"
#include "Websocket.h"
/* wifly interface:
* - p9 and p10 are for the serial communication
* - p25 is for the reset pin
* - p26 is for the connection status
* - "mbed" is the ssid of the network
* - "password" is the password
* - true means that the security of the network is WPA
*/
WiflyInterface wifly(p9, p10, p25, p26, "mbed", "password", true);
int main() {
wifly.init(); //Use DHCP
while (!wifly.connect());
printf("IP Address is %s\n\r", wifly.getIPAddress());
Websocket ws("ws://sockets.mbed.org:443/ws/demo/wo");
while (!ws.connect());
while (1) {
ws.send("WebSocket Hello World over Wifly");
wait(1.0);
}
}
