Wifi

interface Wifi(source)

The unit's Wi-Fi client uplink. Obtain it from wifi; needs NETWORK_WIFI.

The car's own access point stays available while the client is connected: the stock Wi-Fi service runs the access point and the client together. This API only manages the client side (the internet uplink).

connect and disconnect ask the car to act; they return at once. Watch onChanged or poll status for the result. scan blocks until the car reports its results or the timeout expires.

Properties

Link copied to clipboard
val MAX_SCAN_MS: Int = 15000
The longest value accepted by scan, in milliseconds.

Functions

Link copied to clipboard
abstract fun connect(ssid: String, password: String)
Joins ssid.
Link copied to clipboard
abstract fun disconnect()
Leaves the current network.
Link copied to clipboard
abstract fun forget(ssid: String)
Removes a saved network from the car's list.
Link copied to clipboard
abstract fun onChanged(listener: Listener<WifiChanged>): Subscription
Subscribes to state changes.
Link copied to clipboard
abstract fun scan(timeoutMs: Int): List<WifiNetwork>
Asks the car to scan for networks and waits for its results.
Link copied to clipboard
abstract fun status(): WifiStatus
The current uplink state.