Websocket client cellular hello world example

Dependencies:   C027_Support WebSocketClient mbed

Fork of Websocket_Ethernet_HelloWorld by Mbed

Files at this revision

API Documentation at this revision

Comitter:
mazgch
Date:
Tue May 27 09:17:25 2014 +0000
Parent:
7:6468bb94de0c
Child:
9:89538672454c
Commit message:
pull latest lib (update API)

Changed in this revision

C027.lib Show diff for this revision Revisions of this file
C027_Support.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 diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- a/C027.lib	Tue May 13 09:34:32 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://mbed.org/teams/ublox/code/C027/#89c45165ee87
--- a/C027_Support.lib	Tue May 13 09:34:32 2014 +0000
+++ b/C027_Support.lib	Tue May 27 09:17:25 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/teams/ublox/code/C027_Support/#1f65abb842be
+http://mbed.org/teams/ublox/code/C027_Support/#34985b4d821e
--- a/main.cpp	Tue May 13 09:34:32 2014 +0000
+++ b/main.cpp	Tue May 27 09:17:25 2014 +0000
@@ -1,44 +1,37 @@
 #include "mbed.h"
 #include "Websocket.h"
-#include "C027.h"
+
+//------------------------------------------------------------------------------------
+// You need to configure these cellular modem / SIM parameters.
+// These parameters are ignored for LISA-C200 variants and can be left NULL.
+//------------------------------------------------------------------------------------
 #include "MDM.h"
-
-//----------------------------------------------------------------------
-// You may need to configure these parameters
-
-/** Set your secret SIM pin here "1234"
-*/
+//! Set your secret SIM pin here (e.g. "1234"). Check your SIM manual.
 #define SIMPIN      NULL
-
-/** The APN of your network operator, sometimes it is "internet" 
-    check your contract with the network operator
-*/
+/*! The APN of your network operator SIM, sometimes it is "internet" check your 
+    contract with the network operator. You can also try to look-up your settings in 
+    google: https://www.google.de/search?q=APN+list */
 #define APN         "gprs.swisscom.ch"
-
-/** Set the user name for your APN, or NULL if not needed
-*/
+//! Set the user name for your APN, or NULL if not needed
 #define USERNAME    NULL
-
-/** Set the password for your APN, or NULL if not needed
-*/
+//! Set the password for your APN, or NULL if not needed
 #define PASSWORD    NULL 
+//------------------------------------------------------------------------------------
 
 Ticker flash;
 DigitalOut led(LED1);
 void flashLED(void){led = !led;}
-C027 c027;
     
 int main() 
 {
     flash.attach(&flashLED, 1.0f);
-    // turn on the supplies of the Modem
-    c027.mdmPower(true);
-    printf("Modem Initialize\r\n");
     MDMSerial mdm;
-    if (!mdm.connect(SIMPIN, APN,USERNAME,PASSWORD, true))
+    mdm.setDebug(4); // enable this for debugging issues 
+    if (!mdm.connect(SIMPIN, APN,USERNAME,PASSWORD))
         return -1;
     
     // view @ http://sockets.mbed.org/demo/viewer
+    printf("Websocket View at http://sockets.mbed.org/demo/viewer\n");
     Websocket ws("ws://sockets.mbed.org:443/ws/demo/rw");
     
     printf("Websocket\n");
@@ -64,8 +57,6 @@
 
     mdm.disconnect();
     mdm.powerOff();
-    c027.mdmPower(false);
-    printf("Done\n");
     
     while(true);
 }
\ No newline at end of file
--- a/mbed-rtos.lib	Tue May 13 09:34:32 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://mbed.org/users/mbed_official/code/mbed-rtos/#5dfe422a963d
--- a/mbed.bld	Tue May 13 09:34:32 2014 +0000
+++ b/mbed.bld	Tue May 27 09:17:25 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/8a40adfe8776
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/0b3ab51c8877
\ No newline at end of file