Own fork of MbedSmartRestMain

Dependencies:   C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed

Fork of MbedSmartRestMain by Cumulocity Official

Revision:
47:89ae46d5c466
Parent:
46:f6976fd64387
Child:
48:d5e21301543e
--- a/main.cpp	Thu Jul 24 16:02:47 2014 +0000
+++ b/main.cpp	Thu Jul 24 23:32:53 2014 +0000
@@ -1,28 +1,38 @@
 #include "mbed.h"
 #include "rtos.h"
 #include "MDM.h"
+#include "GPS.h"
 #include "DeviceInfo.h"
 #include "MbedAgent.h"
 #include "apndb.h"
+#include "GPSTracker.h"
 
 int main()
 {
     MDMParser::DevStatus devStatus;
-    DeviceIO io;
     int res;
 
-    io.lcdPrint("DEVICE INIT");
-
     MDMSerial mdm;
+    GPSI2C gps;
     //mdm.setDebug(4);
 
     if (!mdm.init(NULL, &devStatus)) {
         puts("Modem initialization failed. Check your PIN number.");
-        io.lcdPrint("MODEM INIT FAILURE");
+        return 1;
+    }
+    puts("Modem initialized");
+
+    /*if (!gps.init()) {
+        puts("GPS initialization failed.");
         return 1;
     }
+    puts("Gps initialized.");*/
+    
+    DeviceIO io(gps);
+    io.lcdPrint("DEVICE INIT");
     
     if (io.resetButtonPressed()) {
+        puts("Resetting program.");
         res = mdm.delFile("001_CREDENTIALS");
         if (res < 0) {
             puts("Credential reset failed.");
@@ -47,6 +57,7 @@
         io.lcdPrint("NO APN FOUND", "IMEI:", devStatus.imsi);
         return 1;
     }
+    puts("Connected.");
     
     if (!mdm.registerNet()) {
         puts("Network registration failed.");