52 lines
1.3 KiB
Lua
52 lines
1.3 KiB
Lua
---@meta
|
|
|
|
-- Generated from native/src/bindings/core/wifi.cpp. Do not edit.
|
|
|
|
---@class WifiNetwork
|
|
---@field ssid string
|
|
---@field rssi integer
|
|
---@field secure boolean
|
|
|
|
---@alias WifiState "disconnected"|"connecting"|"connected"|"not_found"|"failed"
|
|
|
|
---@class WifiStatus
|
|
---@field state WifiState
|
|
---@field ssid string
|
|
---@field ip string
|
|
---@field rssi integer
|
|
|
|
---@class WifiLib
|
|
wifi = {}
|
|
|
|
---Scans for visible networks.
|
|
---@return WifiNetwork[]? networks
|
|
---@return string? error
|
|
function wifi.scan() end
|
|
|
|
---With credentials, saves and joins that network. Without them, reconnects saved credentials.
|
|
---@param ssid? string
|
|
---@param password? string Omit for an open network.
|
|
---@return true? ok
|
|
---@return string? error
|
|
function wifi.connect(ssid, password) end
|
|
|
|
---Returns the current connection state.
|
|
---@return WifiStatus
|
|
function wifi.getStatus() end
|
|
|
|
---Whether the station is associated and has an address.
|
|
---@return boolean
|
|
function wifi.isConnected() end
|
|
|
|
---Returns the station address.
|
|
---@return string IPv4 address, or 0.0.0.0 when disconnected.
|
|
function wifi.getLocalIP() end
|
|
|
|
---Disconnects while retaining saved credentials.
|
|
function wifi.disconnect() end
|
|
|
|
---Disconnects and erases saved credentials.
|
|
---@return true? ok
|
|
---@return string? error
|
|
function wifi.forget() end
|