2011-08-29 22:36:28 +01:00
|
|
|
#ifndef ethernetclient_h
|
|
|
|
#define ethernetclient_h
|
2011-03-01 19:52:13 -05:00
|
|
|
#include "Arduino.h"
|
2008-07-30 14:47:36 +00:00
|
|
|
#include "Print.h"
|
2011-08-29 22:36:28 +01:00
|
|
|
#include "Client.h"
|
2011-03-28 12:08:53 +01:00
|
|
|
#include "IPAddress.h"
|
2008-07-30 14:47:36 +00:00
|
|
|
|
2011-08-29 22:36:28 +01:00
|
|
|
class EthernetClient : public Client {
|
2010-08-02 18:59:44 +00:00
|
|
|
|
2008-07-30 14:47:36 +00:00
|
|
|
public:
|
2011-08-29 22:36:28 +01:00
|
|
|
EthernetClient();
|
|
|
|
EthernetClient(uint8_t sock);
|
2010-08-02 18:59:44 +00:00
|
|
|
|
2008-07-30 14:47:36 +00:00
|
|
|
uint8_t status();
|
2011-03-28 12:08:53 +01:00
|
|
|
virtual int connect(IPAddress ip, uint16_t port);
|
|
|
|
virtual int connect(const char *host, uint16_t port);
|
2011-08-26 16:08:14 -04:00
|
|
|
virtual size_t write(uint8_t);
|
|
|
|
virtual size_t write(const uint8_t *buf, size_t size);
|
2010-08-11 18:19:01 +00:00
|
|
|
virtual int available();
|
|
|
|
virtual int read();
|
2011-01-02 22:21:24 +00:00
|
|
|
virtual int read(uint8_t *buf, size_t size);
|
2010-09-16 01:11:19 +00:00
|
|
|
virtual int peek();
|
2010-08-11 18:19:01 +00:00
|
|
|
virtual void flush();
|
2011-03-28 12:08:53 +01:00
|
|
|
virtual void stop();
|
|
|
|
virtual uint8_t connected();
|
|
|
|
virtual operator bool();
|
2010-08-02 18:59:44 +00:00
|
|
|
|
2011-08-29 22:36:28 +01:00
|
|
|
friend class EthernetServer;
|
2011-09-07 18:41:05 -04:00
|
|
|
|
|
|
|
using Print::write;
|
2010-08-02 18:59:44 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
static uint16_t _srcport;
|
|
|
|
uint8_t _sock;
|
2008-07-30 14:47:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|