WifiInfo

open class WifiInfo : Parcelable
kotlin.Any
   ↳ android.net.wifi.WifiInfo

Describes the state of any Wifi connection that is active or is in the process of being set up.

Summary

Constants
static String

Frequency in MHz
Requires API level 21 (Android 5.0, Lollipop)

static String

Link speed in Mbps

Inherited constants
Public methods
open String

open Int

Returns the current frequency in #FREQUENCY_UNITS.

open Int

Returns the received signal strength indicator of the current 802.

open Int

Returns the current link speed in #LINK_SPEED_UNITS.

open Int

open Unit
writeToParcel(dest: Parcel!, flags: Int)

Implement the Parcelable interface {@hide}

open String!

open Int

Each configured network has a unique small integer ID, used to identify the network when performing operations on the supplicant.

open String!

Return the basic service set identifier (BSSID) of the current access point.

open SupplicantState!

Return the detailed state of the supplicant's negotiation with an access point, in the form of a SupplicantState object.

open String!

Returns the service set identifier (SSID) of the current 802.

open Boolean

open Int

Implement the Parcelable interface {@hide}

open static NetworkInfo.DetailedState!

Map a supplicant state into a fine-grained network connectivity state.

Constants

FREQUENCY_UNITS

added in API level 21
static val FREQUENCY_UNITS: String

Frequency in MHz
Requires API level 21 (Android 5.0, Lollipop)

Value: "MHz"

LINK_SPEED_UNITS

static val LINK_SPEED_UNITS: String

Link speed in Mbps

Value: "Mbps"

Public methods

toString

open fun toString(): String

getFrequency

added in API level 21
open fun getFrequency(): Int

Returns the current frequency in #FREQUENCY_UNITS.
Requires API level 21 (Android 5.0, Lollipop)

Return
Int: the frequency.

See Also

getRssi

open fun getRssi(): Int

Returns the received signal strength indicator of the current 802.11 network, in dBm.

Use android.net.wifi.WifiManager#calculateSignalLevel to convert this number into an absolute signal level which can be displayed to a user.

Return
Int: the RSSI.

getLinkSpeed

open fun getLinkSpeed(): Int

Returns the current link speed in #LINK_SPEED_UNITS.

Return
Int: the link speed.

getIpAddress

open fun getIpAddress(): Int

writeToParcel

open fun writeToParcel(dest: Parcel!, flags: Int): Unit

Implement the Parcelable interface {@hide}

Parameters
dest Parcel!: The Parcel in which the object should be written.
flags Parcel!: Additional flags about how the object should be written. May be 0 or #PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

getMacAddress

open fun getMacAddress(): String!

getNetworkId

open fun getNetworkId(): Int

Each configured network has a unique small integer ID, used to identify the network when performing operations on the supplicant. This method returns the ID for the currently connected network.

Return
Int: the network ID, or -1 if there is no currently connected network

getBSSID

open fun getBSSID(): String!

Return the basic service set identifier (BSSID) of the current access point. The BSSID may be null if there is no network currently connected.

Return
String!: the BSSID, in the form of a six-byte MAC address: XX:XX:XX:XX:XX:XX

getSupplicantState

open fun getSupplicantState(): SupplicantState!

Return the detailed state of the supplicant's negotiation with an access point, in the form of a SupplicantState object.

Return
SupplicantState!: the current SupplicantState

getSSID

open fun getSSID(): String!

Returns the service set identifier (SSID) of the current 802.11 network. If the SSID can be decoded as UTF-8, it will be returned surrounded by double quotation marks. Otherwise, it is returned as a string of hex digits. The SSID may be <unknown ssid> if there is no network currently connected, or if the caller has insufficient permissions to access the SSID. Prior to android.os.Build.VERSION_CODES#JELLY_BEAN_MR1, this method always returned the SSID with no quotes around it.

Return
String!: the SSID

getHiddenSSID

open fun getHiddenSSID(): Boolean
Return
Boolean: true if this network does not broadcast its SSID, so an SSID-specific probe request must be used for scans.

describeContents

open fun describeContents(): Int

Implement the Parcelable interface {@hide}

Return
Int: a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

getDetailedStateOf

open static fun getDetailedStateOf(suppState: SupplicantState!): NetworkInfo.DetailedState!

Map a supplicant state into a fine-grained network connectivity state.

Parameters
suppState SupplicantState!: the supplicant state
Return
NetworkInfo.DetailedState!: the corresponding DetailedState