WLAN authentication is always a tuple
parent
f2cf97f39c
commit
791eda0269
|
@ -335,7 +335,7 @@ The WLAN class belongs to the network module.
|
||||||
|
|
||||||
Constructor:
|
Constructor:
|
||||||
|
|
||||||
`wlan = WLAN(id, mode=WLAN.STA, *, ssid='wlan', auth=WLAN.OPEN, key=None, channel=1, bus=None, pins=None)`
|
`wlan = WLAN(id, mode=WLAN.STA, *, ssid='wlan', auth=None, channel=1, bus=None, pins=None)`
|
||||||
|
|
||||||
Methods:
|
Methods:
|
||||||
|
|
||||||
|
@ -343,12 +343,12 @@ Methods:
|
||||||
- `wlan.deinit()` disable the NIC. NOHEAP.
|
- `wlan.deinit()` disable the NIC. NOHEAP.
|
||||||
- `wlan.mode([mode])` set or get the mode. NOHEAP
|
- `wlan.mode([mode])` set or get the mode. NOHEAP
|
||||||
- `wlan.ssid([ssid])` set or get our own SSID name
|
- `wlan.ssid([ssid])` set or get our own SSID name
|
||||||
- `wlan.security([(auth, key)])` set or get the security configuration tuple
|
- `wlan.auth([(type, key)])` set or get the security configuration tuple
|
||||||
- `wlan.channel([channel])` set or get the channel. NOHEAP
|
- `wlan.channel([channel])` set or get the channel. NOHEAP
|
||||||
- `wlan.scan()` perform a network scan and return a named tuple of the form:
|
- `wlan.scan()` perform a network scan and return a named tuple of the form:
|
||||||
`(ssid, bssid, auth, channel, rssi)`
|
`(ssid, bssid, auth, channel, rssi)`
|
||||||
- `wlan.mac([mac])` get or set the MAC address. The MAC address is a `bytes` object of length 6.
|
- `wlan.mac([mac])` get or set the MAC address. The MAC address is a `bytes` object of length 6.
|
||||||
- `wlan.connect(ssid, *, auth=WLAN.OPEN, key=None, timeout=None)` Connect to the network specified by the SSID using the given authentication and keys.
|
- `wlan.connect(ssid, *, auth=None, key=None, timeout=None)` Connect to the network specified by the SSID using the given authentication and keys.
|
||||||
- `wlan.disconnect()` Closes the current connection. NOHEAP
|
- `wlan.disconnect()` Closes the current connection. NOHEAP
|
||||||
- `wlan.isconnected()` returns `True` if connected and IP address has been assigned. NOHEAP
|
- `wlan.isconnected()` returns `True` if connected and IP address has been assigned. NOHEAP
|
||||||
- `wlan.ifconfig(id=0, config=[(ip, netmask, gateway, dns) or 'dhcp'])` get or set the IP configuration. The `id` is the interface id, and defaults to zero. In the case of `AP+STA` mode, the NIC effectively has 2 interfaces that can be configured independently using `id=0` for the AP and `id=1` for the STA. Alternatively, a port can choose to use string names for the `id`, e.g. `id='STA'` and `id='AP'`.
|
- `wlan.ifconfig(id=0, config=[(ip, netmask, gateway, dns) or 'dhcp'])` get or set the IP configuration. The `id` is the interface id, and defaults to zero. In the case of `AP+STA` mode, the NIC effectively has 2 interfaces that can be configured independently using `id=0` for the AP and `id=1` for the STA. Alternatively, a port can choose to use string names for the `id`, e.g. `id='STA'` and `id='AP'`.
|
||||||
|
@ -359,12 +359,10 @@ Constants:
|
||||||
- `WLAN.AP` Access point mode
|
- `WLAN.AP` Access point mode
|
||||||
- `WLAN.AP+STA` Access point + Station mode (sometimes called SoftAP)
|
- `WLAN.AP+STA` Access point + Station mode (sometimes called SoftAP)
|
||||||
- `WLAN.P2P` Peer to peer (also called WiFi-direct or Ad-Hoc mode)
|
- `WLAN.P2P` Peer to peer (also called WiFi-direct or Ad-Hoc mode)
|
||||||
- `WLAN.OPEN` Open authentication
|
|
||||||
- `WLAN.WEP` WEP authentication
|
- `WLAN.WEP` WEP authentication
|
||||||
- `WLAN.WPA` WPA authentication
|
- `WLAN.WPA` WPA authentication
|
||||||
- `WLAN.WPA2` WPA2 authentication
|
- `WLAN.WPA2` WPA2 authentication
|
||||||
|
|
||||||
|
|
||||||
# machine module
|
# machine module
|
||||||
|
|
||||||
- `machine.reset()` perform a hard reset (same as pressing the reset switch on the board)
|
- `machine.reset()` perform a hard reset (same as pressing the reset switch on the board)
|
||||||
|
|
Loading…
Reference in New Issue