Modified for W5500 Ethernet initialize
Fork of GMMP_mbed by
Network/TCPclient/Client.h@0:7e575e5f88ec, 2015-08-09 (annotated)
- Committer:
- lesmin
- Date:
- Sun Aug 09 14:11:35 2015 +0000
- Revision:
- 0:7e575e5f88ec
forked from GMMP
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lesmin | 0:7e575e5f88ec | 1 | #ifndef Client_h |
lesmin | 0:7e575e5f88ec | 2 | #define Client_h |
lesmin | 0:7e575e5f88ec | 3 | |
lesmin | 0:7e575e5f88ec | 4 | #include "TCPSocketConnection.h" |
lesmin | 0:7e575e5f88ec | 5 | |
lesmin | 0:7e575e5f88ec | 6 | #include "Print.h" |
lesmin | 0:7e575e5f88ec | 7 | #include "Utility.h" |
lesmin | 0:7e575e5f88ec | 8 | |
lesmin | 0:7e575e5f88ec | 9 | /* |
lesmin | 0:7e575e5f88ec | 10 | * TCP Client |
lesmin | 0:7e575e5f88ec | 11 | */ |
lesmin | 0:7e575e5f88ec | 12 | class Client : public Print { |
lesmin | 0:7e575e5f88ec | 13 | public: |
lesmin | 0:7e575e5f88ec | 14 | Client(); |
lesmin | 0:7e575e5f88ec | 15 | ~Client(); |
lesmin | 0:7e575e5f88ec | 16 | |
lesmin | 0:7e575e5f88ec | 17 | virtual int connect(const char *host, uint16_t port); |
lesmin | 0:7e575e5f88ec | 18 | virtual size_t write(uint8_t); |
lesmin | 0:7e575e5f88ec | 19 | //virtual size_t write(const uint8_t *buf, size_t size); |
lesmin | 0:7e575e5f88ec | 20 | virtual size_t write(char *buf, size_t size); //lesmin |
lesmin | 0:7e575e5f88ec | 21 | virtual int available(); |
lesmin | 0:7e575e5f88ec | 22 | virtual int read(); |
lesmin | 0:7e575e5f88ec | 23 | virtual void flush(); |
lesmin | 0:7e575e5f88ec | 24 | virtual void stop(); |
lesmin | 0:7e575e5f88ec | 25 | virtual uint8_t connected(); |
lesmin | 0:7e575e5f88ec | 26 | private: |
lesmin | 0:7e575e5f88ec | 27 | virtual int read(uint8_t *buf, size_t size); |
lesmin | 0:7e575e5f88ec | 28 | uint8_t _buf[1]; |
lesmin | 0:7e575e5f88ec | 29 | uint8_t _len; |
lesmin | 0:7e575e5f88ec | 30 | TCPSocketConnection _sock; |
lesmin | 0:7e575e5f88ec | 31 | }; |
lesmin | 0:7e575e5f88ec | 32 | |
lesmin | 0:7e575e5f88ec | 33 | #endif |