diff options
author | Angus Gratton <angus@redyak.com.au> | 2024-11-05 11:17:32 +1100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2024-11-08 10:11:03 +1100 |
commit | 48f96e96605c020a646adfc2d06ee0db9b87fbe8 (patch) | |
tree | a46152468091583cb0f5bcc710b3357b99963af2 /docs/esp8266/tutorial | |
parent | df6b40a87fe3ddcb37cde488ba1a2060625ab737 (diff) | |
download | micropython-48f96e96605c020a646adfc2d06ee0db9b87fbe8.tar.gz micropython-48f96e96605c020a646adfc2d06ee0db9b87fbe8.zip |
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/tutorial')
-rw-r--r-- | docs/esp8266/tutorial/network_basics.rst | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/docs/esp8266/tutorial/network_basics.rst b/docs/esp8266/tutorial/network_basics.rst index 9d74a6283a..e383c00c6c 100644 --- a/docs/esp8266/tutorial/network_basics.rst +++ b/docs/esp8266/tutorial/network_basics.rst @@ -1,14 +1,15 @@ Network basics ============== -The network module is used to configure the WiFi connection. There are two WiFi -interfaces, one for the station (when the ESP8266 connects to a router) and one -for the access point (for other devices to connect to the ESP8266). Create +The :class:`network.WLAN` class in the :mod:`network` module is used to +configure the WiFi connection. There are two WiFi interfaces, one for +the station (when the ESP8266 connects to a router) and one for the +access point (for other devices to connect to the ESP8266). Create instances of these objects using:: >>> import network - >>> sta_if = network.WLAN(network.STA_IF) - >>> ap_if = network.WLAN(network.AP_IF) + >>> sta_if = network.WLAN(network.WLAN.IF_STA) + >>> ap_if = network.WLAN(network.WLAN.IF_AP) You can check if the interfaces are active by:: @@ -57,7 +58,7 @@ connect to your WiFi network:: def do_connect(): import network - sta_if = network.WLAN(network.STA_IF) + sta_if = network.WLAN(network.WLAN.IF_STA) if not sta_if.isconnected(): print('connecting to network...') sta_if.active(True) |