Own fork of MbedSmartRestMain
Dependencies: C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed
Fork of MbedSmartRestMain by
Diff: main.cpp
- Revision:
- 77:f6717e4eccc4
- Parent:
- 76:b07effe83fb8
- Child:
- 80:757c3ff7b92b
--- a/main.cpp Wed Feb 25 10:06:11 2015 +0000 +++ b/main.cpp Tue Mar 03 14:10:09 2015 +0000 @@ -25,16 +25,25 @@ int main() { - setLevel(A_DEBUG); MDMParser::DevStatus devStatus; int res; uint8_t status = 0; MDMRtos<MDMSerial> mdm; GPSI2C gps; - DeviceIO io(gps); + DeviceIO io(gps); - mdm.setDebug(4); + DigitalIn joystickUp(A2); + DigitalIn joystickDown(A3); + if (joystickUp) { + setLevel(A_DEBUG); + mdm.setDebug(3); + printf("Enable debug mode.\r\n"); + } else { + setLevel(A_INFO); + mdm.setDebug(1); + } + io.lcdPrint("Device Init"); if (!mdm.init(SIM_PIN, &devStatus)) { status = 1; @@ -48,7 +57,7 @@ io.lcdPrint("Register Network", "IMEI", devStatus.imei); if (!mdm.registerNet()) { - io.lcdPrint("Network Reg Error"); + io.lcdPrint("No Network Coverage"); goto error; } @@ -58,7 +67,7 @@ #else if (mdm.join() == NOIP) { #endif - io.lcdPrint("Network join failure", "Check your APN settting,", "username or password"); + io.lcdPrint("Network join failure", "Wrong APN settting,", "username and password"); goto error; } @@ -84,7 +93,7 @@ io.lcdPrint("Agent Init"); if (!agent.init()) { - io.lcdPrint("Agent Init Failure"); + io.lcdPrint("Agent Init Failure", "Debug via serial port"); goto error; } @@ -96,7 +105,7 @@ } while (--tries > 0); if (tries == 0) { - io.lcdPrint("Agent Run Failure"); + io.lcdPrint("Integration/Config Failure"); goto error; } }