Skip to content

Commit

Permalink
WiFiServer - allow constructor without parameters (#9026)
Browse files Browse the repository at this point in the history
  • Loading branch information
JAndrassy authored Nov 12, 2023
1 parent d0f7293 commit ee95373
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions doc/esp8266wifi/server-class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ For most use cases the basic WiFiServer class of the ESP8266WiFi library is suit

Methods and properties described further down are specific to ESP8266. They are not covered in `Arduino WiFi library <https://www.arduino.cc/en/Reference/WiFi>`__ documentation. Before they are fully documented please refer to information below.

begin(port)
~~~~~~~~~~~

Additionally to ``begin()`` without parameter and a constructor with parameter ``port``, ESP8266WiFi library has ``begin(uint16_t port)`` and a constructor without parameters. If port is not specified with constructor and ``begin`` without parameter is used, the server is started on port 23.

accept
~~~~~~

Expand Down
2 changes: 1 addition & 1 deletion libraries/ESP8266WiFi/src/ArduinoWiFiServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ArduinoCompatibleWiFiServerTemplate : public TServer, public Print {
public:

ArduinoCompatibleWiFiServerTemplate(const IPAddress& addr, uint16_t port) : TServer(addr, port) {}
ArduinoCompatibleWiFiServerTemplate(uint16_t port) : TServer(port) {}
ArduinoCompatibleWiFiServerTemplate(uint16_t port = 23) : TServer(port) {}
virtual ~ArduinoCompatibleWiFiServerTemplate() {}

// https://www.arduino.cc/en/Reference/WiFiServerAvailable
Expand Down
2 changes: 1 addition & 1 deletion libraries/ESP8266WiFi/src/WiFiServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class WiFiServer {

public:
WiFiServer(const IPAddress& addr, uint16_t port);
WiFiServer(uint16_t port);
WiFiServer(uint16_t port = 23);
virtual ~WiFiServer() {}
WiFiClient accept(); // https://www.arduino.cc/en/Reference/EthernetServerAccept
WiFiClient available(uint8_t* status = NULL) __attribute__((deprecated("Renamed to accept().")));
Expand Down

0 comments on commit ee95373

Please sign in to comment.