Skip to content

Commit 92f4541

Browse files
committed
added comparison operator to wifiClient class
1 parent fbb44b6 commit 92f4541

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

libraries/WiFiS3/src/WiFiClient.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,13 @@ uint8_t WiFiClient::connected() {
226226
return rv;
227227
}
228228

229+
/* -------------------------------------------------------------------------- */
230+
bool WiFiClient::operator==(const WiFiClient& whs)
231+
{
232+
/* -------------------------------------------------------------------------- */
233+
return _sock == whs._sock;
234+
}
235+
229236
/* -------------------------------------------------------------------------- */
230237
IPAddress WiFiClient::remoteIP() {
231238
/* -------------------------------------------------------------------------- */

libraries/WiFiS3/src/WiFiClient.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ class WiFiClient : public Client {
5454
virtual operator bool() {
5555
return _sock != -1;
5656
}
57-
57+
virtual bool operator==(const WiFiClient&);
58+
virtual bool operator!=(const WiFiClient& whs)
59+
{
60+
return !this->operator==(whs);
61+
};
5862
virtual IPAddress remoteIP();
5963
virtual uint16_t remotePort();
6064

0 commit comments

Comments
 (0)