![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Own fork of MbedSmartRestMain
Dependencies: C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed
Fork of MbedSmartRestMain by
Diff: MbedAgent.cpp
- Revision:
- 71:063c45e99578
- Parent:
- 68:0dc778a16d0d
- Child:
- 72:c5709ae7b193
--- a/MbedAgent.cpp Tue Feb 10 20:52:13 2015 +0000 +++ b/MbedAgent.cpp Mon Feb 16 09:17:30 2015 +0000 @@ -23,18 +23,44 @@ bool MbedAgent::init() { - if ((!_integration.init()) || - (!_configurationSynchronization.init()) || - (!_signalQualityMeasurement.init()) || - (!_temperatureMeasurement.init()) || - (!_accelerationMeasurement.init()) || - (!_analogMeasurement.init()) || - (!_locationUpdate.init()) || - (!_operationSupport.init())) { - puts("Initialization failed."); - return false; + bool flag = true; + if (!_integration.init()) { + puts("Init Device Integration failed."); + flag = false; + } + if (!_configurationSynchronization.init()) { + puts("Init Configuration Synchronization failed."); + flag = false; + } + if (!_signalQualityMeasurement.init()) { + puts("Init Signal Quality Measurement failed."); + flag = false; + } + if (!_temperatureMeasurement.init()) { + puts("Init Temperature Measurement failed."); + flag = false; } - return true; + if (!_accelerationMeasurement.init()) { + puts("Init Acceleration Measurement failed."); + flag = false; + } + if (!_analogMeasurement.init()) { + puts("Init Analog Measurement failed."); + flag = false; + } + if (!_locationUpdate.init()) { + puts("Init Location Measurement failed."); + flag = false; + } + if (!_operationSupport.init()) { + puts("Init Operation Support failed."); + flag = false; + } + if (flag) + puts("T"); + else + puts("F"); + return flag; } bool MbedAgent::run() @@ -45,7 +71,7 @@ Thread::wait(5000); - _io.lcdPrint("INTEGRATION"); + _io.lcdPrint("Connect to Cloud"); if (!_integration.integrate()) { return false; } @@ -56,7 +82,7 @@ char status[60]; snprintf(status, sizeof(status), "ID: %ld", _deviceId); - _io.lcdPrint("INTEGRATED", status); + _io.lcdPrint("Connected", status); loop();