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: WebSocketClient EthernetInterface mbed-rtos mbed
main.cpp
00001 #include "mbed.h" 00002 #include "EthernetInterface.h" 00003 #include "Websocket.h" 00004 00005 00006 int main() { 00007 char recv[30]; 00008 00009 EthernetInterface eth; 00010 eth.init(); //Use DHCP 00011 eth.connect(); 00012 printf("IP Address is %s\n\r", eth.getIPAddress()); 00013 00014 Websocket ws("ws://sockets.mbed.org:443/ws/demo/wo"); 00015 ws.connect(); 00016 00017 while (1) { 00018 ws.send("WebSocket Hello World over Ethernet"); 00019 wait(1.0); 00020 } 00021 }
Generated on Thu Jul 14 2022 03:27:10 by
1.7.2