Official reference client implementation for Cumulocity SmartREST on u-blox C027.

Dependencies:   C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed

Fork of MbedSmartRestMain by Vincent Wochnik

Revision:
46:f6976fd64387
Parent:
45:5d8feae26fe3
Child:
47:89ae46d5c466
--- a/main.cpp	Thu Jul 24 14:52:44 2014 +0000
+++ b/main.cpp	Thu Jul 24 16:02:47 2014 +0000
@@ -9,6 +9,7 @@
 {
     MDMParser::DevStatus devStatus;
     DeviceIO io;
+    int res;
 
     io.lcdPrint("DEVICE INIT");
 
@@ -20,6 +21,18 @@
         io.lcdPrint("MODEM INIT FAILURE");
         return 1;
     }
+    
+    if (io.resetButtonPressed()) {
+        res = mdm.delFile("001_CREDENTIALS");
+        if (res < 0) {
+            puts("Credential reset failed.");
+            io.lcdPrint("CREDENTIAL RESET", "FAILURE", "PLEASE RESTART DEVICE");
+        } else {
+            puts("Credential reset successful.");
+            io.lcdPrint("CREDENTIAL RESET", "SUCCESS", "PLEASE RESTART DEVICE");
+        }
+        return 0;
+    }
 
     io.lcdPrint("IMEI", devStatus.imei);
 
@@ -31,7 +44,7 @@
     apndb_t *apn = apndb_get(devStatus.imsi);
     if (apn == NULL) {
         puts("No APN found. Stop.");
-        io.lcdPrint("NO APN FOUND", devStatus.imsi);
+        io.lcdPrint("NO APN FOUND", "IMEI:", devStatus.imsi);
         return 1;
     }