Notes
- The function returns immediately. A
trueresult just means the disconnection process has successfully started. - To check for a successful disconnection you can use the wifi.onDisconnected event.
wifi.disconnect()function
The wifi.disconnect() function tries to disconnect from the WIFI endpoint.
Return value
Returns aboolean value indicating if the disconnection process has correctly started.
Example
--! luart-extensions
import wifi
function wifi.onDisconnected()
print("You are disconnected from the wireless network !")
sys.exit()
end
wifi.connect("your wifi endpoint")
-- sleeps for 5sec then disconnect
sleep(5000)
wifi.disconnect()
waitall()