A client for the SmartREST protocol from Cumulocity.
Fork of MbedSmartRest by
MbedDataSource.h
- Committer:
- vwochnik
- Date:
- 2014-04-16
- Revision:
- 17:57dd24cb6620
- Parent:
- 13:e76920d5e1ec
File content as of revision 17:57dd24cb6620:
#ifndef MBEDDATASOURCE_H #define MBEDDATASOURCE_H #include <stddef.h> #include "AbstractDataSource.h" #include "TCPSocketConnection.h" #define MBED_SOURCE_BUFFER_SIZE 60 class MbedClient; class MbedDataSource : public AbstractDataSource { public: MbedDataSource(TCPSocketConnection& sock); ~MbedDataSource(); char read(); uint8_t status(); protected: bool receive(); void reset(); private: TCPSocketConnection& _sock; char _buf[MBED_SOURCE_BUFFER_SIZE]; size_t _len, _offset; bool _timeout; friend class MbedClient; }; #endif