A client for the SmartREST protocol from Cumulocity.

Dependencies:   HTTPClient SmartRest

Committer:
vwochnik
Date:
Wed Feb 05 16:21:46 2014 +0000
Revision:
10:478414cc15a4
Parent:
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 4:0eb69392686f 10 static int x = 123;
vwochnik 4:0eb69392686f 11 class HTTPBuffer : public IHTTPDataIn, 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 4:0eb69392686f 19
vwochnik 4:0eb69392686f 20 void writeReset();
vwochnik 2:1038411466a6 21
vwochnik 2:1038411466a6 22 protected:
vwochnik 2:1038411466a6 23 int write(const char* buf, size_t len);
vwochnik 2:1038411466a6 24 void setDataType(const char* type);
vwochnik 2:1038411466a6 25 void setIsChunked(bool chunked);
vwochnik 2:1038411466a6 26 void setDataLen(size_t len);
vwochnik 2:1038411466a6 27 void bufferSize(size_t length);
vwochnik 2:1038411466a6 28
vwochnik 10:478414cc15a4 29 //private:
vwochnik 10:478414cc15a4 30 public:
vwochnik 2:1038411466a6 31 // buffer, write and read pointers
vwochnik 2:1038411466a6 32 char *_buf, *_wptr, *_rptr;
vwochnik 2:1038411466a6 33 size_t _len;
vwochnik 2:1038411466a6 34 };
vwochnik 2:1038411466a6 35
vwochnik 2:1038411466a6 36 #endif