Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions libraries/WiFiS3/src/WiFiClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,13 @@ uint8_t WiFiClient::connected() {
return rv;
}

/* -------------------------------------------------------------------------- */
bool WiFiClient::operator==(const WiFiClient& whs)
{
/* -------------------------------------------------------------------------- */
return _sock == whs._sock;
}

/* -------------------------------------------------------------------------- */
IPAddress WiFiClient::remoteIP() {
/* -------------------------------------------------------------------------- */
Expand Down
6 changes: 5 additions & 1 deletion libraries/WiFiS3/src/WiFiClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ class WiFiClient : public Client {
virtual operator bool() {
return _sock != -1;
}

virtual bool operator==(const WiFiClient&);
virtual bool operator!=(const WiFiClient& whs)
{
return !this->operator==(whs);
};
virtual IPAddress remoteIP();
virtual uint16_t remotePort();

Expand Down
4 changes: 4 additions & 0 deletions libraries/WiFiS3/src/WiFiSSLClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ uint8_t WiFiSSLClient::connected() {
}
return rv;
}
bool WiFiSSLClient::operator==(const WiFiSSLClient& whs)
{
return _sock == whs._sock;
}

/* -------------------------------------------------------------------------- */
IPAddress WiFiSSLClient::remoteIP() {
Expand Down
6 changes: 5 additions & 1 deletion libraries/WiFiS3/src/WiFiSSLClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ class WiFiSSLClient : public WiFiClient {
virtual operator bool() {
return _sock != -1;
}

virtual bool operator==(const WiFiSSLClient&);
virtual bool operator!=(const WiFiSSLClient& whs)
{
return !this->operator==(whs);
};
virtual IPAddress remoteIP();
virtual uint16_t remotePort();

Expand Down
5 changes: 5 additions & 0 deletions libraries/WiFiS3/src/WiFiServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,9 @@ void WiFiServer::end() {
modem.write(string(PROMPT(_SERVEREND)),res, "%s%d\r\n" , CMD_WRITE(_SERVEREND), _sock);
_sock = -1;
}
}

bool WiFiServer::operator==(const WiFiServer& whs)
{
return _sock == whs._sock;
}
6 changes: 5 additions & 1 deletion libraries/WiFiS3/src/WiFiServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ class WiFiServer : public Server {
virtual size_t write(uint8_t);
virtual size_t write(const uint8_t *buf, size_t size);
void end();

virtual bool operator==(const WiFiServer&);
virtual bool operator!=(const WiFiServer& whs)
{
return !this->operator==(whs);
};

using Print::write;

Expand Down
7 changes: 6 additions & 1 deletion libraries/WiFiS3/src/WiFiUdp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,12 @@ void WiFiUDP::flush() {
modem.write(string(PROMPT(_UDPFLUSH)),res, "%s%d\r\n" , CMD_WRITE(_UDPFLUSH), _sock);
}
}


bool WiFiUDP::operator==(const WiFiUDP& whs)
{
return _sock == whs._sock;
}

/* -------------------------------------------------------------------------- */
IPAddress WiFiUDP::remoteIP() {
/* -------------------------------------------------------------------------- */
Expand Down
5 changes: 5 additions & 0 deletions libraries/WiFiS3/src/WiFiUdp.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ class WiFiUDP : public UDP {
// Return the next byte from the current packet without moving on to the next byte
virtual int peek();
virtual void flush(); // Finish reading the current packet
virtual bool operator==(const WiFiUDP&);
virtual bool operator!=(const WiFiUDP& whs)
{
return !this->operator==(whs);
};

// Return the IP address of the host who sent the current incoming packet
virtual IPAddress remoteIP();
Expand Down