Own fork of MbedSmartRestMain

Dependencies:   C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed

Fork of MbedSmartRestMain by Cumulocity Official

DeviceBootstrap.h

Committer:
xinlei
Date:
2015-05-13
Revision:
109:b7a403dbceb6
Parent:
100:dbcd3bc51758
Child:
112:3872569be2af

File content as of revision 109:b7a403dbceb6:

#ifndef DEVICEBOOTSTRAP_H
#define DEVICEBOOTSTRAP_H

#include <stddef.h>
#include "AbstractSmartRest.h"
#include "DeviceInfo.h"

#define CREDENTIAL_LENGTH 256

class DeviceBootstrap
{
public:
    DeviceBootstrap(AbstractSmartRest&, DeviceInfo&);

    bool setUpCredentials();
    const char* username() const { return _username; }
    const char* password() const { return _password; }

protected:
    bool obtainFromPlatform();

private:
    void setCredentials(const char *, const char*, const char*);

private:
    AbstractSmartRest& _client;
    DeviceInfo& _deviceInfo;
    char _username[CREDENTIAL_LENGTH];
    char _password[CREDENTIAL_LENGTH];
};

#endif