Skip to content

Commit c12b35f

Browse files
committed
WiFiS3 WiFiServer operator bool
1 parent b82e642 commit c12b35f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Diff for: libraries/WiFiS3/src/WiFiServer.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,12 @@ void WiFiServer::end() {
8484
}
8585
}
8686

87+
WiFiServer::operator bool()
88+
{
89+
return (_sock != -1);
90+
}
91+
8792
bool WiFiServer::operator==(const WiFiServer& whs)
8893
{
8994
return _sock == whs._sock;
90-
}
95+
}

Diff for: libraries/WiFiS3/src/WiFiServer.h

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class WiFiServer : public Server {
4242
virtual size_t write(uint8_t);
4343
virtual size_t write(const uint8_t *buf, size_t size);
4444
void end();
45+
virtual operator bool();
4546
virtual bool operator==(const WiFiServer&);
4647
virtual bool operator!=(const WiFiServer& whs)
4748
{

0 commit comments

Comments
 (0)