From b92df059b4eca2e2f876fc0365eb4731587bc0ac Mon Sep 17 00:00:00 2001
From: Rotzbua <Rotzbua@users.noreply.github.com>
Date: Fri, 24 Jun 2022 12:10:02 +0200
Subject: [PATCH 1/2] Doc: Update deprecation of `setAutoConnect`...

... and `getAutoConnect`
---
 docs/source/api/wifi.rst       | 21 ++++-----------------
 libraries/WiFi/src/WiFiSTA.cpp |  6 ++++--
 2 files changed, 8 insertions(+), 19 deletions(-)

diff --git a/docs/source/api/wifi.rst b/docs/source/api/wifi.rst
index 5f1d100493e..4808d92fb06 100644
--- a/docs/source/api/wifi.rst
+++ b/docs/source/api/wifi.rst
@@ -446,26 +446,12 @@ Return the connection state.
 setAutoConnect
 **************
 
-Function used to set the automatic connection.
-
-.. code-block:: arduino
-
-    bool setAutoConnect(bool autoConnect);
-
-Where:
-
-* ``bool autoConnect`` is set to ``true`` to enable this option.
+Function is deprecated.
 
 getAutoConnect
 **************
 
-Function used to get the automatic connection setting value.
-
-.. code-block:: arduino
-
-    bool getAutoConnect();
-
-The function will return ``true`` if the setting is enabled.
+Function is deprecated.
 
 setAutoReconnect
 ****************
@@ -484,11 +470,12 @@ getAutoReconnect
 ****************
 
 Function used to get the automatic reconnection if the connection is lost.
+
 .. code-block:: arduino
 
     bool getAutoReconnect();
 
-    The function will return ``true`` if this setting is enabled.
+The function will return ``true`` if this setting is enabled.
 
 WiFiMulti
 ---------
diff --git a/libraries/WiFi/src/WiFiSTA.cpp b/libraries/WiFi/src/WiFiSTA.cpp
index f93f4bae0f7..adb8f290517 100644
--- a/libraries/WiFi/src/WiFiSTA.cpp
+++ b/libraries/WiFi/src/WiFiSTA.cpp
@@ -430,8 +430,9 @@ void WiFiSTAClass::setSortMethod(wifi_sort_method_t sortMethod)
 }
 
 /**
- * Setting the ESP32 station to connect to the AP (which is recorded)
+ * Deprecated. Setting the ESP32 station to connect to the AP (which is recorded)
  * automatically or not when powered on. Enable auto-connect by default.
+ * @deprecated use `setAutoReconnect`
  * @param autoConnect bool
  * @return if saved
  */
@@ -441,8 +442,9 @@ bool WiFiSTAClass::setAutoConnect(bool autoConnect)
 }
 
 /**
- * Checks if ESP32 station mode will connect to AP
+ * Deprecated. Checks if ESP32 station mode will connect to AP
  * automatically or not when it is powered on.
+ * @deprecated use `getAutoReconnect`
  * @return auto connect
  */
 bool WiFiSTAClass::getAutoConnect()

From e18bda2964eb6c1d9c9067d984c80fe04fe446b2 Mon Sep 17 00:00:00 2001
From: Rotzbua <Rotzbua@users.noreply.github.com>
Date: Fri, 24 Jun 2022 12:11:31 +0200
Subject: [PATCH 2/2] Doc: Add doc to `setAutoReconnect`..

.. and `getAutoReconnect`
---
 libraries/WiFi/src/WiFiSTA.cpp | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/libraries/WiFi/src/WiFiSTA.cpp b/libraries/WiFi/src/WiFiSTA.cpp
index adb8f290517..859d6cf3eaa 100644
--- a/libraries/WiFi/src/WiFiSTA.cpp
+++ b/libraries/WiFi/src/WiFiSTA.cpp
@@ -452,12 +452,20 @@ bool WiFiSTAClass::getAutoConnect()
     return false;//now deprecated
 }
 
+/**
+ * Function used to set the automatic reconnection if the connection is lost. 
+ * @param autoReconnect `true` to enable this option.
+ * @return true 
+ */
 bool WiFiSTAClass::setAutoReconnect(bool autoReconnect)
 {
     _autoReconnect = autoReconnect;
     return true;
 }
-
+/**
+ * Function used to get the automatic reconnection if the connection is lost.
+ * @return The function will return `true` if this setting is enabled.
+ */
 bool WiFiSTAClass::getAutoReconnect()
 {
     return _autoReconnect;