Skip to content

Commit

Permalink
WiFiServer operator bool
Browse files Browse the repository at this point in the history
  • Loading branch information
JAndrassy committed Sep 24, 2023
1 parent 12c33f1 commit 12a5c9e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/WiFiServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ uint8_t WiFiServer::status() {
}
}

WiFiServer::operator bool() {
return (_sock != NO_SOCKET_AVAIL);
}

size_t WiFiServer::write(uint8_t b)
{
Expand Down
1 change: 1 addition & 0 deletions src/WiFiServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class WiFiServer : public Server {
virtual size_t write(uint8_t);
virtual size_t write(const uint8_t *buf, size_t size);
uint8_t status();
operator bool();

using Print::write;
};
Expand Down

0 comments on commit 12a5c9e

Please sign in to comment.