wifi.disconnect()function


The wifi.disconnect() function tries to disconnect from the WIFI endpoint.

Notes

  • The function returns immediately. A true result just means the disconnection process has successfully started.
  • To check for a successful disconnection you can use the wifi.onDisconnected event.

Return value

Returns a boolean 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()