Official reference client implementation for Cumulocity SmartREST on u-blox C027.
Dependencies: C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed
Fork of MbedSmartRestMain by
DeviceBootstrap.h
- Committer:
- xinlei
- Date:
- 2015-04-13
- Revision:
- 93:0acd11870c6a
- Parent:
- 92:48069375dffa
- Child:
- 96:5dfdc8568e9f
File content as of revision 93:0acd11870c6a:
#ifndef DEVICEBOOTSTRAP_H #define DEVICEBOOTSTRAP_H #include <stddef.h> #include "LCDDisplay.h" #include "DeviceMemory.h" #include "AbstractSmartRest.h" #include "DeviceInfo.h" /** The username used for device bootstrapping. */ #define DEVICE_BOOTSTRAP_USERNAME "management/devicebootstrap" /** The password used for device bootstrapping. */ #define DEVICE_BOOTSTRAP_PASSWORD "Fhdt1bb1f" #define DEVICE_BOOTSTRAP_CREDENTIALS_LENGTH 256 class DeviceBootstrap { public: DeviceBootstrap(AbstractSmartRest&, LCDDisplay&, DeviceInfo&, DeviceMemory&); bool setUpCredentials(); const char * username(); const char * password(); protected: bool obtainFromStorage(); bool obtainFromPlatform(); private: bool writeToStorage(); void setCredentials(const char *, const char*, const char*); private: AbstractSmartRest& _client; DeviceInfo& _deviceInfo; DeviceMemory& _deviceMemory; LCDDisplay& _lcdDisplay; char _username[DEVICE_BOOTSTRAP_CREDENTIALS_LENGTH]; char _password[DEVICE_BOOTSTRAP_CREDENTIALS_LENGTH]; }; #endif