copy lib

Fork of GMMP by SKTelecom_ThingPlug

Committer:
lesmin
Date:
Thu Aug 13 07:04:29 2015 +0000
Revision:
5:bb6c1ee1d5f0
Parent:
0:32c20cfb2b30
added NTP error return

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lesmin 0:32c20cfb2b30 1 #ifndef Client_h
lesmin 0:32c20cfb2b30 2 #define Client_h
lesmin 0:32c20cfb2b30 3
lesmin 0:32c20cfb2b30 4 #include "TCPSocketConnection.h"
lesmin 0:32c20cfb2b30 5
lesmin 0:32c20cfb2b30 6 #include "Print.h"
lesmin 0:32c20cfb2b30 7 #include "Utility.h"
lesmin 0:32c20cfb2b30 8
lesmin 0:32c20cfb2b30 9 /*
lesmin 0:32c20cfb2b30 10 * TCP Client
lesmin 0:32c20cfb2b30 11 */
lesmin 0:32c20cfb2b30 12 class Client : public Print {
lesmin 0:32c20cfb2b30 13 public:
lesmin 0:32c20cfb2b30 14 Client();
lesmin 0:32c20cfb2b30 15 ~Client();
lesmin 0:32c20cfb2b30 16
lesmin 0:32c20cfb2b30 17 virtual int connect(const char *host, uint16_t port);
lesmin 0:32c20cfb2b30 18 virtual size_t write(uint8_t);
lesmin 0:32c20cfb2b30 19 //virtual size_t write(const uint8_t *buf, size_t size);
lesmin 0:32c20cfb2b30 20 virtual size_t write(char *buf, size_t size); //lesmin
lesmin 0:32c20cfb2b30 21 virtual int available();
lesmin 0:32c20cfb2b30 22 virtual int read();
lesmin 0:32c20cfb2b30 23 virtual void flush();
lesmin 0:32c20cfb2b30 24 virtual void stop();
lesmin 0:32c20cfb2b30 25 virtual uint8_t connected();
lesmin 0:32c20cfb2b30 26 private:
lesmin 0:32c20cfb2b30 27 virtual int read(uint8_t *buf, size_t size);
lesmin 0:32c20cfb2b30 28 uint8_t _buf[1];
lesmin 0:32c20cfb2b30 29 uint8_t _len;
lesmin 0:32c20cfb2b30 30 TCPSocketConnection _sock;
lesmin 0:32c20cfb2b30 31 };
lesmin 0:32c20cfb2b30 32
lesmin 0:32c20cfb2b30 33 #endif