ARM mbed M2X API Client: The ARM mbed client library is used to send/receive data to/from AT&T's M2X service from mbed LPC1768 microcontrollers.
Dependents: m2x-demo-all M2X_MTS_ACCEL_DEMO M2X_MTS_Accel M2X_K64F_ACCEL ... more
Diff: Client.h
- Revision:
- 0:f479e4f4db0e
- Child:
- 12:debf4b2f7960
diff -r 000000000000 -r f479e4f4db0e Client.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Client.h Wed Feb 12 19:43:34 2014 +0000 @@ -0,0 +1,32 @@ +#ifndef Client_h +#define Client_h + +#include "TCPSocketConnection.h" + +#include "Print.h" +#include "Utility.h" + +/* + * TCP Client + */ +class Client : public Print { +public: + Client(); + ~Client(); + + virtual int connect(const char *host, uint16_t port); + virtual size_t write(uint8_t); + virtual size_t write(const uint8_t *buf, size_t size); + virtual int available(); + virtual int read(); + virtual void flush(); + virtual void stop(); + virtual uint8_t connected(); +private: + virtual int read(uint8_t *buf, size_t size); + uint8_t _buf[1]; + uint8_t _len; + TCPSocketConnection _sock; +}; + +#endif