portable version of the cumulocity demo

Dependencies:   C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed

Fork of MbedSmartRestMain by Cumulocity Official

Revision:
29:853741b9ea3b
Parent:
28:2004400abeec
Child:
30:daa499571db7
--- a/main.cpp	Sun May 25 17:46:19 2014 +0000
+++ b/main.cpp	Mon May 26 08:10:27 2014 +0000
@@ -2,8 +2,6 @@
 #include "apndb.h"
 #include "io.h"
 
-#define SIMPIN      NULL
- 
 C027 c027;
 MDMSerial mdm;
 sigq_t sigQ = {};
@@ -25,7 +23,7 @@
     Thread::wait(2000);
 
     puts("Initializing modem.");
-    if (!mdm.init(SIMPIN, &devStatus)) {
+    if (!mdm.init(NULL, &devStatus)) {
         puts("Modem initialization failed. Check your PIN number.");
         return 1;
     }
@@ -36,6 +34,10 @@
         puts("No APN found. Stop.");
         return 1;
     }
+    
+    // print out basic device data
+    printf("IMEI: %s\n", devStatus.imei);
+    printf("IMSI: %s\n", devStatus.imsi);
 
     // wait until we are connected
     int i = 60;
@@ -50,9 +52,10 @@
         return 1;
     }
 
+    printf("Carrier: %s\n", apn->carrier);
     puts("Joining Network.");
-    if (mdm.join(apn->apn, apn->user, apn->pass) == NOIP) {
-        puts("Could not join network. Check APN and credentials.");
+    if (mdm.join(apn->apn) == NOIP) {
+        puts("Could not join network. Make sure chosen carrier is correct and no credentials are required.");
         return 1;
     }