![](/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: DeviceBootstrap.cpp
- Revision:
- 77:f6717e4eccc4
- Parent:
- 72:c5709ae7b193
- Child:
- 88:8ab476939897
diff -r b07effe83fb8 -r f6717e4eccc4 DeviceBootstrap.cpp --- a/DeviceBootstrap.cpp Wed Feb 25 10:06:11 2015 +0000 +++ b/DeviceBootstrap.cpp Tue Mar 03 14:10:09 2015 +0000 @@ -73,8 +73,7 @@ _client.stop(); Thread::wait(2000); continue; - } - + } if (_client.receive(recvdRecord) != SMARTREST_SUCCESS) { _client.stop(); Thread::wait(2000); @@ -82,15 +81,15 @@ } _client.stop(); - for (size_t q = 0; q < recvdRecord.values(); q++) - aDebug(recvdRecord.rawValue(q)); - + if (getLevel() == A_DEBUG) { + for (size_t q = 0; q < recvdRecord.values(); q++) + aDebug("Bootstrap, received: %s\r\n", recvdRecord.rawValue(q)); + } if ((recvdRecord.values() < 1) || (recvdRecord.value(0).integerValue() == 50)) { Thread::wait(2000); continue; } - if ((recvdRecord.value(0).integerValue() != 70) || (recvdRecord.values() != 6)) { return false; @@ -98,10 +97,8 @@ setCredentials(recvdRecord.value(3).characterValue(), recvdRecord.value(4).characterValue(), - recvdRecord.value(5).characterValue()); - + recvdRecord.value(5).characterValue()); _io.lcdPrint("Bootstrap Success", _username, _password); - return true; } while (--tries > 0);