A client for the SmartREST protocol from Cumulocity.
Dependencies: HTTPClient SmartRest
Diff: MbedClient.h
- Revision:
- 3:ce2f116369bd
- Child:
- 5:ab909221d22d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MbedClient.h Fri Jan 24 21:05:24 2014 +0000 @@ -0,0 +1,28 @@ +#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 \ No newline at end of file