summaryrefslogtreecommitdiff
path: root/docs/esp8266/quickref.rst
diff options
context:
space:
mode:
authorAngus Gratton <angus@redyak.com.au>2024-11-05 11:17:32 +1100
committerDamien George <damien@micropython.org>2024-11-08 10:11:03 +1100
commit48f96e96605c020a646adfc2d06ee0db9b87fbe8 (patch)
treea46152468091583cb0f5bcc710b3357b99963af2 /docs/esp8266/quickref.rst
parentdf6b40a87fe3ddcb37cde488ba1a2060625ab737 (diff)
docs: Specify the recommended network.WLAN.IF_[AP|STA] constants.
Removes the deprecated network.[AP|STA]_IF form from the docs. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
Diffstat (limited to 'docs/esp8266/quickref.rst')
-rw-r--r--docs/esp8266/quickref.rst8
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/esp8266/quickref.rst b/docs/esp8266/quickref.rst
index b130ce65d..6f02da95d 100644
--- a/docs/esp8266/quickref.rst
+++ b/docs/esp8266/quickref.rst
@@ -49,11 +49,11 @@ The :mod:`esp` module::
Networking
----------
-The :mod:`network` module::
+The :class:`network.WLAN` class in the :mod:`network` module::
import network
- wlan = network.WLAN(network.STA_IF) # create station interface
+ wlan = network.WLAN(network.WLAN.IF_STA) # create station interface
wlan.active(True) # activate the interface
wlan.scan() # scan for access points
wlan.isconnected() # check if the station is connected to an AP
@@ -61,7 +61,7 @@ The :mod:`network` module::
wlan.config('mac') # get the interface's MAC address
wlan.ipconfig('addr4') # get the interface's IPv4 addresses
- ap = network.WLAN(network.AP_IF) # create access-point interface
+ ap = network.WLAN(network.WLAN.IF_AP) # create access-point interface
ap.active(True) # activate the interface
ap.config(ssid='ESP-AP') # set the SSID of the access point
@@ -69,7 +69,7 @@ A useful function for connecting to your local WiFi network is::
def do_connect():
import network
- wlan = network.WLAN(network.STA_IF)
+ wlan = network.WLAN(network.WLAN.IF_STA)
wlan.active(True)
if not wlan.isconnected():
print('connecting to network...')