docs/wipy: Make wifi/wlan naming consistent with tutorial.rst.

This commit is contained in:
Chris Liechti 2015-11-10 01:10:50 +01:00 committed by danicampora
parent 9142179f81
commit 426f326d35

View File

@ -184,16 +184,16 @@ See :ref:`network.WLAN <network.WLAN>` and :mod:`machine`. ::
from network import WLAN from network import WLAN
# configure the WLAN subsystem in station mode (the default is AP) # configure the WLAN subsystem in station mode (the default is AP)
wifi = WLAN(mode=WLAN.STA) wlan = WLAN(mode=WLAN.STA)
# go for fixed IP settings # go for fixed IP settings
wifi.ifconfig(config=('192.168.0.107', '255.255.255.0', '192.168.0.1', '8.8.8.8')) wlan.ifconfig(config=('192.168.0.107', '255.255.255.0', '192.168.0.1', '8.8.8.8'))
wifi.scan() # scan for available networks wlan.scan() # scan for available networks
wifi.connect(ssid='mynetwork', auth=(WLAN.WPA2, 'mynetworkkey')) wlan.connect(ssid='mynetwork', auth=(WLAN.WPA2, 'mynetworkkey'))
while not wifi.isconnected(): while not wlan.isconnected():
pass pass
print(wifi.ifconfig()) print(wlan.ifconfig())
# enable wake on WLAN # enable wake on WLAN
wifi.irq(trigger=WLAN.ANY_EVENT, wake=machine.SLEEP) wlan.irq(trigger=WLAN.ANY_EVENT, wake=machine.SLEEP)
# go to sleep # go to sleep
machine.sleep() machine.sleep()
# now, connect to the FTP or the Telnet server and the WiPy will wake-up # now, connect to the FTP or the Telnet server and the WiPy will wake-up