http client example

Dependencies:   C027_Support HTTPClient mbed

Fork of HTTPClient_HelloWorld by Donatien Garnier

Revision:
6:6ff6061a0f76
Parent:
5:a18ddbfd70c9
Child:
7:b14d0f112a73
--- a/main.cpp	Tue May 13 09:34:52 2014 +0000
+++ b/main.cpp	Tue May 27 09:17:49 2014 +0000
@@ -1,39 +1,31 @@
 #include "mbed.h"
 #include "HTTPClient.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 
-
-C027 c027;
+//------------------------------------------------------------------------------------
 
 char str[512];
 
 int main() 
 {
     // 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;
     
     HTTPClient http;
@@ -100,8 +92,6 @@
 
     mdm.disconnect();
     mdm.powerOff();
-    c027.mdmPower(false);
-    printf("Done\n");
-    
+
     while(true);
 }