A client for the SmartREST protocol from Cumulocity.
Fork of MbedSmartRest by
MbedDataSource.h
00001 #ifndef MBEDDATASOURCE_H 00002 #define MBEDDATASOURCE_H 00003 00004 #include <stddef.h> 00005 #include "AbstractDataSource.h" 00006 #include "TCPSocketConnection.h" 00007 00008 #define MBED_SOURCE_BUFFER_SIZE 60 00009 00010 class MbedClient; 00011 00012 class MbedDataSource : public AbstractDataSource 00013 { 00014 public: 00015 MbedDataSource(TCPSocketConnection& sock); 00016 ~MbedDataSource(); 00017 00018 char read(); 00019 uint8_t status(); 00020 00021 protected: 00022 bool receive(); 00023 void reset(); 00024 00025 private: 00026 TCPSocketConnection& _sock; 00027 char _buf[MBED_SOURCE_BUFFER_SIZE]; 00028 size_t _len, _offset; 00029 bool _timeout; 00030 00031 friend class MbedClient; 00032 }; 00033 00034 #endif
Generated on Mon Jul 18 2022 17:08:34 by 1.7.2