esp32: Use the recommended network.WLAN.IF_[AP|STA] constants.

Removes the deprecated network.[AP|STA]_IF form from the esp32 port

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
This commit is contained in:
Angus Gratton
2024-11-05 11:18:37 +11:00
committed by Damien George
parent 48f96e9660
commit 285e1d0b80
4 changed files with 4 additions and 4 deletions

View File

@@ -195,7 +195,7 @@ quickly call `wlan_connect()` and it just works):
```python
def wlan_connect(ssid='MYSSID', password='MYPASS'):
import network
wlan = network.WLAN(network.STA_IF)
wlan = network.WLAN(network.WLAN.IF_STA)
if not wlan.active() or not wlan.isconnected():
wlan.active(True)
print('connecting to:', ssid)

View File

@@ -30,7 +30,7 @@ class OLED(SSD1306_I2C):
self.text("Scan...", 0, 0, 1)
self.show()
sta_if = network.WLAN(network.STA_IF)
sta_if = network.WLAN(network.WLAN.IF_STA)
sta_if.active(True)
_wifi = sta_if.scan()

View File

@@ -37,7 +37,7 @@ class OLED(SSD1306_I2C):
self.text("Scan...", 0, 0, 1)
self.show()
sta_if = network.WLAN(network.STA_IF)
sta_if = network.WLAN(network.WLAN.IF_STA)
sta_if.active(True)
_wifi = sta_if.scan()

View File

@@ -48,7 +48,7 @@ const char esp32_help_text[] =
"Basic WiFi configuration:\n"
"\n"
"import network\n"
"sta_if = network.WLAN(network.STA_IF); sta_if.active(True)\n"
"sta_if = network.WLAN(network.WLAN.IF_STA); sta_if.active(True)\n"
"sta_if.scan() # Scan for available access points\n"
"sta_if.connect(\"<AP_name>\", \"<password>\") # Connect to an AP\n"
"sta_if.isconnected() # Check for successful connection\n"