NerfUS
Dependencies: mbed mbed-rtos HardwareInterface EthernetInterface WebSocketClient
Revision 17:8c77b958edd7, committed 2017-03-01
- Comitter:
- ericmatte
- Date:
- Wed Mar 01 03:55:37 2017 +0000
- Parent:
- 16:97ea8b3fd5a4
- Commit message:
- Working Ethernet
Changed in this revision
HardwareInterface.lib | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/HardwareInterface.lib Wed Mar 01 01:49:26 2017 +0000 +++ b/HardwareInterface.lib Wed Mar 01 03:55:37 2017 +0000 @@ -1,1 +1,1 @@ -https://developer.mbed.org/teams/NerfUS/code/HardwareInterface/#664dfa189c79 +https://developer.mbed.org/teams/NerfUS/code/HardwareInterface/#0a7810520b9e
--- a/main.cpp Wed Mar 01 01:49:26 2017 +0000 +++ b/main.cpp Wed Mar 01 03:55:37 2017 +0000 @@ -1,13 +1,32 @@ #include "rtos.h" #include "HardwareLPC1768.hpp" +#include "WSRequest.hpp" DigitalOut led(LED1); +/** Allow simple communication with a websocket server */ +void serverCommunication() +{ + WSRequest server("ws://192.168.64.42:8000/"); + char buf[32] = "Testing the server"; + printf("Sending message to server: %s", buf); + server.send(buf); + + while(1) + { + server.onMessage(buf); + printf("Received: %s\n\r", buf); + } +} + int main() { + // serverCommunication(); + HardwareLPC1768 hardware_lpc1768(led); while(1) { + hardware_lpc1768.blink(); } }