
Own fork of MbedSmartRestMain
Dependencies: C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed
Fork of MbedSmartRestMain by
Revision 109:b7a403dbceb6, committed 2015-05-13
- Comitter:
- xinlei
- Date:
- Wed May 13 15:00:24 2015 +0000
- Parent:
- 108:2ec12f10ebf4
- Child:
- 110:ee9ae4a5e55c
- Commit message:
- small fix for when there are no pending operations
Changed in this revision
--- a/DeviceBootstrap.cpp Wed May 13 13:54:17 2015 +0000 +++ b/DeviceBootstrap.cpp Wed May 13 15:00:24 2015 +0000 @@ -28,13 +28,6 @@ bool DeviceBootstrap::setUpCredentials() { -// if ((*_username == '\0' || *_password == '\0') && -// (!obtainFromStorage())) { -// if (!obtainFromPlatform()) -// return false; -// if (!writeToStorage()) -// aError("Can not write credentials!\n"); -// } if (loadCredential(_username, _password, CREDENTIAL_LENGTH)) { return true; } else if (obtainFromPlatform()) { @@ -46,21 +39,6 @@ } } -const char * DeviceBootstrap::username() -{ - return _username; -} - -const char * DeviceBootstrap::password() -{ - return _password; -} - -bool DeviceBootstrap::obtainFromStorage() -{ - return loadCredential(_username, _password, CREDENTIAL_LENGTH); -} - bool DeviceBootstrap::obtainFromPlatform() { ComposedRecord record; @@ -111,11 +89,6 @@ return false; } -bool DeviceBootstrap::writeToStorage() -{ - return saveCredential(_username, _password, CREDENTIAL_LENGTH); -} - void DeviceBootstrap::setCredentials(const char *tenant, const char *username, const char *password) { *_username = '\0';
--- a/DeviceBootstrap.h Wed May 13 13:54:17 2015 +0000 +++ b/DeviceBootstrap.h Wed May 13 15:00:24 2015 +0000 @@ -13,15 +13,13 @@ DeviceBootstrap(AbstractSmartRest&, DeviceInfo&); bool setUpCredentials(); - const char * username(); - const char * password(); + const char* username() const { return _username; } + const char* password() const { return _password; } protected: - bool obtainFromStorage(); bool obtainFromPlatform(); private: - bool writeToStorage(); void setCredentials(const char *, const char*, const char*); private:
--- a/DeviceIntegration.cpp Wed May 13 13:54:17 2015 +0000 +++ b/DeviceIntegration.cpp Wed May 13 15:00:24 2015 +0000 @@ -8,11 +8,11 @@ DeviceIntegration::DeviceIntegration(AbstractSmartRest& client, SmartRestTemplate& tpl, DeviceInfo& deviceInfo) : + _init(false), _tpl(tpl), _client(client), _deviceInfo(deviceInfo) { - _init = false; } bool DeviceIntegration::init()
--- a/mbed.bld Wed May 13 13:54:17 2015 +0000 +++ b/mbed.bld Wed May 13 15:00:24 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/8ab26030e058 \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/dbbf35b96557 \ No newline at end of file
--- a/operation/OperationSupport.cpp Wed May 13 13:54:17 2015 +0000 +++ b/operation/OperationSupport.cpp Wed May 13 15:00:24 2015 +0000 @@ -81,7 +81,9 @@ } else break; } - if (i >= N) + if (i == 0) + return true; + else if (i >= N) aWarning("Over %u pending operations.\n", N); ControlParser cp(opool); bool flag = true;