A Secure WebSocket client example that shows how to use the WebSocket library in SharkSSL-Lite
Dependencies: EthernetInterface SharkSSL-Lite mbed-rtos mbed
The example connects to an online echo service and requires that you connect a terminal via the ''mbed Serial Port'. Windows users must install the Windows serial port driver.
The following screenshot shows Putty connected to the mbed serial terminal and after entering a few lines of text.
main.cpp@0:3a00a9689a7e, 2016-04-06 (annotated)
- Committer:
- wini
- Date:
- Wed Apr 06 16:43:26 2016 +0000
- Revision:
- 0:3a00a9689a7e
First release
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
wini | 0:3a00a9689a7e | 1 | #include "mbed.h" |
wini | 0:3a00a9689a7e | 2 | #include "EthernetInterface.h" |
wini | 0:3a00a9689a7e | 3 | #include <selib.h> |
wini | 0:3a00a9689a7e | 4 | |
wini | 0:3a00a9689a7e | 5 | int main() { |
wini | 0:3a00a9689a7e | 6 | EthernetInterface eth; |
wini | 0:3a00a9689a7e | 7 | eth.init(); //Use DHCP |
wini | 0:3a00a9689a7e | 8 | eth.connect(); |
wini | 0:3a00a9689a7e | 9 | printf("IP Address is %s\n", eth.getIPAddress()); |
wini | 0:3a00a9689a7e | 10 | mainTask(0); |
wini | 0:3a00a9689a7e | 11 | error("mainTask returned"); |
wini | 0:3a00a9689a7e | 12 | } |
wini | 0:3a00a9689a7e | 13 |