Tests

Dependencies:   EthernetInterface WebSocketClient mbed-rtos mbed

Fork of Websocket_Ethernet_HelloWorld by Samuel Mokrani

Files at this revision

API Documentation at this revision

Comitter:
GaiSensei
Date:
Mon Feb 13 17:48:34 2017 +0000
Parent:
2:00da1457c871
Commit message:
Test websockets

Changed in this revision

EthernetInterface.lib Show annotated file Show diff for this revision Revisions of this file
WebSocketClient.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
mbed-rtos.lib Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- a/EthernetInterface.lib	Thu Aug 23 14:11:49 2012 +0000
+++ b/EthernetInterface.lib	Mon Feb 13 17:48:34 2017 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/EthernetInterface/#0d9ae7845bfe
+https://developer.mbed.org/teams/Team-APP1/code/EthernetInterface/#3f4995e0e6c7
--- a/WebSocketClient.lib	Thu Aug 23 14:11:49 2012 +0000
+++ b/WebSocketClient.lib	Mon Feb 13 17:48:34 2017 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/samux/code/WebSocketClient/#466f90b7849a
+http://mbed.org/users/samux/code/WebSocketClient/#4567996414a5
--- a/main.cpp	Thu Aug 23 14:11:49 2012 +0000
+++ b/main.cpp	Mon Feb 13 17:48:34 2017 +0000
@@ -2,19 +2,25 @@
 #include "EthernetInterface.h"
 #include "Websocket.h"
  
+Serial pc(USBTX, USBRX);
+static const char*          mbedIp       = "192.168.0.180";  //IP
+static const char*          mbedMask     = "255.255.255.0";  // Mask
+static const char*          mbedGateway  = "192.168.0.1";    //Gateway
  
-int main() {
+int main() 
+{
     char recv[30];
  
     EthernetInterface eth;
-    eth.init(); //Use DHCP
+    pc.printf("mbed connected : %d\r\n", eth.init(mbedIp, mbedMask, mbedGateway));
     eth.connect();
-    printf("IP Address is %s\n\r", eth.getIPAddress());
+    pc.printf("IP Address is %s\r\n", eth.getIPAddress());
  
-    Websocket ws("ws://sockets.mbed.org:443/ws/demo/wo");
-    ws.connect();
+    Websocket ws("ws://169.254.55.70:8080/");
+    pc.printf("mbed connected to server : %d\r\n", ws.connect());
  
-    while (1) {
+    while (1) 
+    {
         ws.send("WebSocket Hello World over Ethernet");
         wait(1.0);
     }
--- a/mbed-rtos.lib	Thu Aug 23 14:11:49 2012 +0000
+++ b/mbed-rtos.lib	Mon Feb 13 17:48:34 2017 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed-rtos/#70bd33086f56
+http://mbed.org/users/mbed_official/code/mbed-rtos/#58563e6cba1e
--- a/mbed.bld	Thu Aug 23 14:11:49 2012 +0000
+++ b/mbed.bld	Mon Feb 13 17:48:34 2017 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/10b9abbe79a6
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/176b8275d35d
\ No newline at end of file