![](/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:
- 52:8f1370084268
- Parent:
- 47:89ae46d5c466
- Child:
- 57:4af5f1bec3a6
--- a/MbedAgent.cpp Tue Jul 29 17:53:43 2014 +0000 +++ b/MbedAgent.cpp Wed Aug 13 10:55:11 2014 +0000 @@ -6,7 +6,7 @@ _mdm(mdm), _deviceInfo(deviceInfo), _client(MBED_AGENT_HOST, MBED_AGENT_PORT, MBED_AGENT_DEVICE_IDENTIFIER), - _bootstrap(_client, _mdm, _deviceInfo), + _bootstrap(_client, _mdm, _io, _deviceInfo), _integration(_client, _tpl, _deviceId, _deviceInfo), _signalQualityMeasurement(_client, _tpl, _deviceId, _deviceInfo), _temperatureMeasurement(_client, _tpl, _deviceId, _io.temperatureSensor()), @@ -34,25 +34,19 @@ bool MbedAgent::run() { // device bootstrapping process - _io.lcdPrint("BOOTSTRAP", _deviceInfo.imei()); - if (!_bootstrap.setUpCredentials()) { - _io.lcdPrint("BOOTSTRAP FAILURE"); - puts("Could not obtain credentials."); + if (!_bootstrap.setUpCredentials()) return false; - } - _io.lcdPrint("BOOTSTRAP SUCCESSFUL", _bootstrap.username(), _bootstrap.password()); + Thread::wait(5000); _io.lcdPrint("INTEGRATION"); if (!_integration.integrate()) { - puts("Device integration process failed."); return false; } char status[60]; snprintf(status, sizeof(status), "ID: %ld", _deviceId); _io.lcdPrint("INTEGRATED", status); - puts(status); loop(); return true; @@ -66,9 +60,7 @@ while (true) { timer.reset(); - puts("Sending signal quality."); - if (!_signalQualityMeasurement.run()) - puts("Failed signal str."); + _signalQualityMeasurement.run(); _temperatureMeasurement.run(); _accelerationMeasurement.run(); _analogMeasurement.run();