Skip to content

Commit f5b81be

Browse files
projectgusdpgeorge
authored andcommitted
esp8266: Use the recommended network.WLAN.IF_[AP|STA] constants.
Removes the deprecated network.[AP|STA]_IF form from the esp8266 port This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <[email protected]>
1 parent 285e1d0 commit f5b81be

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

ports/esp8266/help.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ const char esp_help_text[] =
3636
"Basic WiFi configuration:\n"
3737
"\n"
3838
"import network\n"
39-
"sta_if = network.WLAN(network.STA_IF); sta_if.active(True)\n"
39+
"sta_if = network.WLAN(network.WLAN.IF_STA); sta_if.active(True)\n"
4040
"sta_if.scan() # Scan for available access points\n"
4141
"sta_if.connect(\"<AP_name>\", \"<key>\") # Connect to an AP\n"
4242
"sta_if.isconnected() # Check for successful connection\n"
4343
"# Change name/password of ESP8266's AP:\n"
44-
"ap_if = network.WLAN(network.AP_IF)\n"
44+
"ap_if = network.WLAN(network.WLAN.IF_AP)\n"
4545
"ap_if.config(ssid=\"<AP_NAME>\", security=network.AUTH_WPA_WPA2_PSK, key=\"<key>\")\n"
4646
"\n"
4747
"Control commands:\n"

ports/esp8266/modules/inisetup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
def wifi():
77
import binascii
88

9-
ap_if = network.WLAN(network.AP_IF)
9+
ap_if = network.WLAN(network.WLAN.IF_AP)
1010
ssid = b"MicroPython-%s" % binascii.hexlify(ap_if.config("mac")[-3:])
1111
ap_if.config(ssid=ssid, security=network.AUTH_WPA_WPA2_PSK, key=b"micropythoN")
1212

ports/esp8266/modules/port_diag.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ def main():
2323
print(esp.check_fw())
2424

2525
print("\nNetworking:")
26-
print("STA ifconfig:", network.WLAN(network.STA_IF).ifconfig())
27-
print("AP ifconfig:", network.WLAN(network.AP_IF).ifconfig())
26+
print("STA ifconfig:", network.WLAN(network.WLAN.IF_STA).ifconfig())
27+
print("AP ifconfig:", network.WLAN(network.WLAN.IF_AP).ifconfig())
2828
print("Free WiFi driver buffers of type:")
2929
for i, comm in enumerate(
3030
("1,2 TX", "4 Mngmt TX(len: 0x41-0x100)", "5 Mngmt TX (len: 0-0x40)", "7", "8 RX")

0 commit comments

Comments
 (0)