Notes
- The function returns immediately. A
trueresult just means the connection process has successfully started. - To check for a successful connection you can use the wifi.onConnected event.
wifi.connect(endpoint, [password], [authmethod], [encryptmethod])function
The wifi.connect() function try to connect to the specified WIFI endpoint. If the endpoint is already known by Windows, password won't be needed.
Parameters
endpoint
A string representing the WIFI endpoint name.
[password]
A string representing the password if the wireless network is not already known by Windows.
[authmethod]
An optional string representing the authentification method to use among those values :
"WPA" : PA-Enterprise 802.11 authentication."WPAPSK" : WPA-Personal 802.11 authentication."WPA2" : WPA2-Enterprise 802.11 authentication."WPA2PSK" : WPA2-Personal 802.11 authentication (the default)."WPA3ENT192" : WPA3-Enterprise 192-bit mode authentication.[encryptmethod]
An optional string representing the encryption method to use among those values :
"none" : no encryption"WEP" – WEP encryption"TKIP" : TKIP encryption"AES" : AES encryption (the default)"GCMP256" : GCMP256 encryptionReturn value
Returns aboolean value indicating if the connection process has correctly started.
Example
--! luart-extensions
import wifi
function wifi.onConnected()
print("You are connected to "..wifi.name)
sys.exit()
end
wifi.connect("my wifi endpoint")
waitall()