A client for the SmartREST protocol from Cumulocity.

Dependencies:   SmartRest

Fork of MbedSmartRest by Vincent Wochnik

MbedClient.h

Committer:
vwochnik
Date:
2014-01-24
Revision:
3:ce2f116369bd
Child:
5:ab909221d22d

File content as of revision 3:ce2f116369bd:

#ifndef MBEDCLIENT_H
#define MBEDCLIENT_H

#include "AbstractClient.h"
#include "HTTPBuffer.h"
#include "HTTPGeneratorWrapper.h"
#include "HTTPClient.h"

class MbedClient : public AbstractClient {
public:
    MbedClient(const char*, const char*, const char*);

    uint8_t beginRequest();
    uint8_t sendIdentifier(const char*);
    uint8_t sendData(DataGenerator& generator);
    uint8_t endRequest();
    uint8_t awaitResponse();
    AbstractDataSource& receiveData();
    void stop();

private:
    const char *_url, *_username, *_password;
    HTTPClient _client;
    HTTPBuffer _buffer;
    uint8_t _state;
};

#endif