Skip to content

Commit

Permalink
improve comments ?
Browse files Browse the repository at this point in the history
  • Loading branch information
d-a-v committed Dec 9, 2023
1 parent a68b4ef commit 5ba81b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions doc/esp8266wifi/station-class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Note that to reenable DHCP, all three parameters as 0.0.0.0 (local_ip, gateway a

.. code:: cpp
WiFi.config(local_ip, gateway, subnet) (discouraged, dns is not set but it is useful)
WiFi.config(local_ip, gateway, subnet) (discouraged, insufficiently accurate, for Arduino API portability)
WiFi.config(local_ip, gateway, subnet, dns1)
WiFi.config(local_ip, gateway, subnet, dns1, dns2)
Expand All @@ -126,9 +126,9 @@ For Arduino networking API compatibility, the ESP8266WiFi library supports IPv4-

.. code:: cpp
WiFi.config(local_ip) (discouraged, for retro compatibility: dns=gateway=···.1)
WiFi.config(local_ip, dns) (discouraged, for retro compatibility: gateway=···.1)
WiFi.config(local_ip, dns, gateway) (discouraged, for retro compatibility: subnet/netmask quite unavoidable)
WiFi.config(local_ip) (discouraged, insufficiently accurate, for Arduino API portability)
WiFi.config(local_ip, dns) (discouraged, insufficiently accurate, for Arduino API portability)
WiFi.config(local_ip, dns, gateway) (discouraged, insufficiently accurate, for Arduino API portability)
WiFi.config(local_ip, dns, gateway, subnet)
Versions where some of ``dns``, ``gateway`` and ``subnet`` parameters are not specified use a default value. Default ``subnet`` is 255.255.255.0. Default ``gateway`` and ``dns`` are derived from ``local_ip`` by changing the last number to 1 (discouraged). To return to DHCP you can use ``WiFi.config(INADDR_NONE);``.
Expand Down
2 changes: 1 addition & 1 deletion libraries/ESP8266WiFi/src/ESP8266WiFiSTA.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class ESP8266WiFiSTAClass: public LwipIntf {

// two and one parameter version. 2nd parameter is DNS like in Arduino
// IPv4 only
[[deprecated("It is discouraged to use this 1 or 2 parameters network configuration legacy function config(ip[,dns]) because it sets the router (and ommited dns) to an arbitrary address")]]
[[deprecated("It is discouraged to use this 1 or 2 parameters network configuration legacy function config(ip[,dns]) because it is insufficiently accurate")]]
bool config(IPAddress local_ip, IPAddress dns = INADDR_ANY);

bool setDNS(IPAddress dns1, IPAddress dns2 = INADDR_ANY);
Expand Down

0 comments on commit 5ba81b6

Please sign in to comment.