Own fork of MbedSmartRestMain
Dependencies: C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed
Fork of MbedSmartRestMain by
Diff: MbedAgent.cpp
- Revision:
- 112:3872569be2af
- Parent:
- 108:2ec12f10ebf4
- Child:
- 114:c54e9731b9de
--- a/MbedAgent.cpp Fri May 15 10:14:05 2015 +0000 +++ b/MbedAgent.cpp Fri May 15 14:07:51 2015 +0000 @@ -74,13 +74,9 @@ int MbedAgent::run() { // device bootstrapping process - if (!_bootstrap.setUpCredentials()) { - LCDDisplay::inst().setLines("Bootstrap error"); + if (!_bootstrap.bootstrap()) { return -1; } - setAuth(_bootstrap.username(), _bootstrap.password()); - aInfo("Set auth: %s:%s (%s)\n", srUsername, srPassword, srAuthStr); - Thread::wait(2000); LCDDisplay::inst().setLines("Connect to Cloud", srHost); @@ -106,7 +102,7 @@ while (true) { int l = 0; for (size_t i = 0; i < N; ++i) { -// if (reporters[i] == NULL) { +// if (reporters[i] == &ConfigSync::inst()) { int l2 = reporters[i]->read(buf2+l, sizeof(buf2)-l, status, DISPLAY_LEN); if (l2) { // Refresh LCD display needed LCDDisplay::inst().setThirdLine(status); @@ -121,7 +117,8 @@ } if (l) { l = snprintf(buf, sizeof(buf), fmtSmartRest, "/s", l, buf2); - l = sock.sendOnly(buf, l); +// l = sock.sendOnly(buf, l); + l = sock.sendAndReceive(buf, l, sizeof(buf)); if (l < 0) aWarning("%s\n", status); }