Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed
Fork of MbedSmartRestMain by
Diff: main.cpp
- Revision:
- 88:b1de34154513
- Parent:
- 81:4a7761914901
- Child:
- 89:8ab476939897
diff -r a01faf58e938 -r b1de34154513 main.cpp
--- a/main.cpp Mon Mar 09 09:48:05 2015 +0000
+++ b/main.cpp Wed Mar 11 10:02:35 2015 +0000
@@ -59,9 +59,29 @@
status = 2;
io.lcdPrint("GPS Init Failure");
}
- if (status != 0)
- goto error;
+ if (status != 0) {
+ mdm.disconnect();
+ mdm.powerOff();
+ return 1;
+ }
+ DeviceInfo deviceInfo(mdm, devStatus);
+ DeviceMemory deviceMemory(mdm);
+
+ if (io.resetButtonPressed()) {
+ io.lcdPrint("Factory Reset");
+ if (deviceMemory.resetPlatformCredentials()) {
+// io.deviceFeedback().beepSuccess();
+ io.lcdPrint("Reset Success");
+ }
+ else {
+// io.deviceFeedback().beepFailure();
+ io.lcdPrint("Reset Failure");
+ }
+ Thread::wait(1000);
+ return 0;
+ }
+
io.lcdPrint("Register Network", "IMEI", devStatus.imei);
if (!mdm.registerNet()) {
io.lcdPrint("No Network Coverage");
@@ -84,23 +104,6 @@
}
{
- DeviceInfo deviceInfo(mdm, devStatus);
- DeviceMemory deviceMemory(mdm);
-
- if (io.resetButtonPressed()) {
- io.lcdPrint("Factory Reset");
- if (deviceMemory.resetPlatformCredentials()) {
-// io.deviceFeedback().beepSuccess();
- io.lcdPrint("Reset Success");
- }
- else {
-// io.deviceFeedback().beepFailure();
- io.lcdPrint("Reset Failure");
- }
- Thread::wait(1000);
- return 0;
- }
-
MbedAgent agent(io, mdm, deviceInfo, deviceMemory);
io.lcdPrint("Agent Init");

Cumulocity