Own fork of MbedSmartRestMain
Dependencies: C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed
Fork of MbedSmartRestMain by
Diff: DeviceBootstrap.cpp
- Revision:
- 97:9f2de96941c4
- Parent:
- 95:5dfdc8568e9f
- Child:
- 100:dbcd3bc51758
diff -r ea056f6be2e8 -r 9f2de96941c4 DeviceBootstrap.cpp --- a/DeviceBootstrap.cpp Mon Apr 27 13:02:50 2015 +0000 +++ b/DeviceBootstrap.cpp Mon Apr 27 13:30:21 2015 +0000 @@ -3,6 +3,7 @@ #include <string.h> #include "DeviceBootstrap.h" #include "rtos.h" +#include "DeviceMemory.h" #include "LCDDisplay.h" #include "ComposedRecord.h" #include "CharValue.h" @@ -12,10 +13,9 @@ #include "logging.h" DeviceBootstrap::DeviceBootstrap(AbstractSmartRest& client, - DeviceInfo& deviceInfo, DeviceMemory& deviceMemory) : + DeviceInfo& deviceInfo) : _client(client), - _deviceInfo(deviceInfo), - _deviceMemory(deviceMemory) + _deviceInfo(deviceInfo) { *_username = *_password = '\0'; } @@ -44,7 +44,7 @@ bool DeviceBootstrap::obtainFromStorage() { - return _deviceMemory.loadPlatformCredentials(_username, _password, DEVICE_BOOTSTRAP_CREDENTIALS_LENGTH); + return loadPlatformCredentials(_username, _password, DEVICE_BOOTSTRAP_CREDENTIALS_LENGTH); } bool DeviceBootstrap::obtainFromPlatform() @@ -99,7 +99,7 @@ bool DeviceBootstrap::writeToStorage() { - return _deviceMemory.savePlatformCredentials(_username, _password, DEVICE_BOOTSTRAP_CREDENTIALS_LENGTH); + return savePlatformCredentials(_username, _password, DEVICE_BOOTSTRAP_CREDENTIALS_LENGTH); } void DeviceBootstrap::setCredentials(const char *tenant, const char *username, const char *password)