A client for the SmartREST protocol from Cumulocity.

Dependencies:   HTTPClient SmartRest

Committer:
vwochnik
Date:
Fri Jan 24 21:05:24 2014 +0000
Revision:
3:ce2f116369bd
Parent:
2:1038411466a6
Child:
4:0eb69392686f
fix

Who changed what in which revision?

UserRevisionLine numberNew contents of line
vwochnik 2:1038411466a6 1 #ifndef HTTPBUFFER_H
vwochnik 2:1038411466a6 2 #define HTTPBUFFER_H
vwochnik 2:1038411466a6 3
vwochnik 2:1038411466a6 4 #include <stddef.h>
vwochnik 2:1038411466a6 5 #include "IHTTPData.h"
vwochnik 2:1038411466a6 6 #include "AbstractDataSource.h"
vwochnik 2:1038411466a6 7
vwochnik 2:1038411466a6 8 #define HTTPBUFFER_INITIAL_SIZE 128
vwochnik 2:1038411466a6 9 #define HTTPBUFFER_INCREMENT 64
vwochnik 2:1038411466a6 10
vwochnik 3:ce2f116369bd 11 class HTTPBuffer : public HTTPDataIn, public AbstractDataSource
vwochnik 3:ce2f116369bd 12 {
vwochnik 2:1038411466a6 13 public:
vwochnik 2:1038411466a6 14 HTTPBuffer();
vwochnik 2:1038411466a6 15 ~HTTPBuffer();
vwochnik 2:1038411466a6 16
vwochnik 2:1038411466a6 17 char read();
vwochnik 2:1038411466a6 18 uint8_t status();
vwochnik 2:1038411466a6 19
vwochnik 2:1038411466a6 20 protected:
vwochnik 2:1038411466a6 21 void writeReset();
vwochnik 2:1038411466a6 22 int write(const char* buf, size_t len);
vwochnik 2:1038411466a6 23 void setDataType(const char* type);
vwochnik 2:1038411466a6 24 void setIsChunked(bool chunked);
vwochnik 2:1038411466a6 25 void setDataLen(size_t len);
vwochnik 2:1038411466a6 26 void bufferSize(size_t length);
vwochnik 2:1038411466a6 27
vwochnik 2:1038411466a6 28 private:
vwochnik 2:1038411466a6 29 // buffer, write and read pointers
vwochnik 2:1038411466a6 30 char *_buf, *_wptr, *_rptr;
vwochnik 2:1038411466a6 31 size_t _len;
vwochnik 2:1038411466a6 32 };
vwochnik 2:1038411466a6 33
vwochnik 2:1038411466a6 34 #endif