Skip to content

Doc: Update deprecation of setAutoConnect, etc.. #6908

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 4 additions & 17 deletions docs/source/api/wifi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
****************
Expand All @@ -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
---------
Expand Down
16 changes: 13 additions & 3 deletions libraries/WiFi/src/WiFiSTA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -441,21 +442,30 @@ 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()
{
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;
Expand Down