Websocket client test with Vodafone USB Modems

Dependencies:   WebSocketClient VodafoneUSBModem mbed mbed-rtos

Fork of VodafoneK3770WebsocketTestBeta by Donatien Garnier

Revision:
2:cc30dc616fa2
Parent:
1:3106409d5fe3
Child:
4:0f0cd888156b
--- a/main.cpp	Fri Aug 17 16:15:52 2012 +0000
+++ b/main.cpp	Fri Aug 17 16:16:18 2012 +0000
@@ -1,51 +1,50 @@
-#include "mbed.h"
-#include "VodafoneUSBModem.h"
-#include "Websocket.h"
-
-void test(void const*) 
-{
-    VodafoneUSBModem modem;
-    Websocket ws("ws://sockets.mbed.org:443/ws/demo/rw");
-    char recv[128];
-    
-    //int ret = modem.connect("pp.vodafone.co.uk");
-    int ret = modem.connect("websfr");
-    if(ret)
-    {
-      printf("Could not connect\n");
-      return;
-    }
-    
-    ws.connect();
- 
-    for(int i = 0; i < 500; i++)
-    {
-        if(!(i%100))
-            ws.send("WebSocket Hello World over the Vodafone Network!");
- 
-        if (ws.read(recv)) {
-            printf("rcv: %s\r\n", recv);
-        }
- 
-        Thread::wait(10);
-    }
-    
-    modem.disconnect();  
-
-    while(1) {
-    }
-}
-
-
-int main()
-{
-  Thread testTask(test, NULL, osPriorityNormal, 1024 * 4);
-  DigitalOut led(LED1);
-  while(1)
-  {
-    led=!led;
-    Thread::wait(1000);  
-  }
-
-  return 0;
-}
+#include "mbed.h"
+#include "VodafoneUSBModem.h"
+#include "Websocket.h"
+
+void test(void const*) 
+{
+    VodafoneUSBModem modem;
+    Websocket ws("ws://sockets.mbed.org:443/ws/demo/rw");
+    char recv[128];
+    
+    int ret = modem.connect("pp.vodafone.co.uk");
+    if(ret)
+    {
+      printf("Could not connect\n");
+      return;
+    }
+    
+    ws.connect();
+ 
+    for(int i = 0; i < 500; i++)
+    {
+        if(!(i%100))
+            ws.send("WebSocket Hello World over the Vodafone Network!");
+ 
+        if (ws.read(recv)) {
+            printf("rcv: %s\r\n", recv);
+        }
+ 
+        Thread::wait(10);
+    }
+    
+    modem.disconnect();  
+
+    while(1) {
+    }
+}
+
+
+int main()
+{
+  Thread testTask(test, NULL, osPriorityNormal, 1024 * 4);
+  DigitalOut led(LED1);
+  while(1)
+  {
+    led=!led;
+    Thread::wait(1000);  
+  }
+
+  return 0;
+}