8#ifndef ethernetclient_h
9#define ethernetclient_h
60 virtual int connect(IPAddress ip, uint16_t port);
72 virtual int connect(
const char *host, uint16_t port);
79 virtual size_t write(uint8_t b);
93 virtual size_t write(
const uint8_t *buf,
size_t size);
115 virtual int read(uint8_t *buf,
size_t size);
129 virtual void flush();
157 virtual operator bool();
166 return bool() == value;
176 return bool() != value;
218 return (_tcp_client->
pcb->local_port);
229 return (IPAddress(_tcp_client->
pcb->remote_ip.addr));
240 return (_tcp_client->
pcb->remote_port);
249 _connectionTimeout = timeout;
258 bool _owns_tcp_client =
false;
259 uint16_t _connectionTimeout = 10000;
Definition EthernetClient.h:16
virtual void flush()
Sends any data still queued for transmission.
Definition EthernetClient.cpp:184
virtual uint8_t connected()
Checks whether the client is connected.
Definition EthernetClient.cpp:212
virtual int peek()
Returns the next byte without removing it from the buffer.
Definition EthernetClient.cpp:173
EthernetClient()
Default constructor. Creates a client with no connection.
Definition EthernetClient.cpp:19
virtual int connect(IPAddress ip, uint16_t port)
Connects to a remote host by IP address.
Definition EthernetClient.cpp:51
virtual bool operator==(const bool value)
Compares the client's boolean value with a value.
Definition EthernetClient.h:164
uint8_t status()
Returns the state of the TCP connection.
Definition EthernetClient.cpp:219
virtual void stop()
Closes the connection and releases the client structure.
Definition EthernetClient.cpp:193
virtual size_t write(uint8_t b)
Writes one byte to the connection.
Definition EthernetClient.cpp:94
virtual int available()
Returns the number of bytes ready to be read.
Definition EthernetClient.cpp:145
virtual uint16_t localPort()
Returns the local TCP port of the connection.
Definition EthernetClient.h:216
virtual IPAddress remoteIP()
Returns the remote IP address of the connection.
Definition EthernetClient.h:227
uint8_t getSocketNumber()
Returns the socket number, for W5100 compatibility.
Definition EthernetClient.cpp:241
virtual int read()
Reads one byte from the receive buffer.
Definition EthernetClient.cpp:154
virtual bool operator!=(const EthernetClient &rhs)
Tests whether two clients refer to different connections.
Definition EthernetClient.h:195
void setConnectionTimeout(uint16_t timeout)
Sets how long connect() waits for the connection (ms).
Definition EthernetClient.h:247
virtual uint16_t remotePort()
Returns the remote TCP port of the connection.
Definition EthernetClient.h:238
virtual bool operator!=(const bool value)
Compares the client's boolean value with a value.
Definition EthernetClient.h:174
Definition EthernetServer.h:16
Include stm32_eth source files.
Definition stm32_eth.h:77
struct tcp_pcb * pcb
Definition stm32_eth.h:78