Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of M2XStreamClient by
Client.h
00001 #ifndef Client_h 00002 #define Client_h 00003 00004 #include "TCPSocketConnection.h" 00005 00006 #include "Print.h" 00007 #include "Utility.h" 00008 00009 /* 00010 * TCP Client 00011 */ 00012 class Client : public Print { 00013 public: 00014 Client(); 00015 ~Client(); 00016 00017 virtual int connect(const char *host, uint16_t port); 00018 virtual size_t write(uint8_t); 00019 virtual size_t write(const uint8_t *buf, size_t size); 00020 virtual int available(); 00021 virtual int read(); 00022 virtual void flush(); 00023 virtual void stop(); 00024 virtual uint8_t connected(); 00025 private: 00026 virtual int read(uint8_t *buf, size_t size); 00027 void _fillin(void); 00028 uint8_t _inbuf[128]; 00029 uint8_t _incnt; 00030 void _flushout(void); 00031 uint8_t _outbuf[128]; 00032 uint8_t _outcnt; 00033 TCPSocketConnection _sock; 00034 }; 00035 00036 #endif
Generated on Wed Jul 13 2022 05:32:06 by
