ScanResult
class ScanResult : Parcelable
| kotlin.Any | |
| ↳ | android.net.wifi.ScanResult |
Describes information about a detected access point. In addition to the attributes described here, the supplicant keeps track of quality, noise, and maxbitrate attributes, but does not currently report them to external clients.
Summary
| Nested classes | |
|---|---|
|
information elements from beacon. |
|
| Constants | |
|---|---|
| static Int |
AP Channel bandwidth is 160 MHZ |
| static Int |
AP Channel bandwidth is 20 MHZ |
| static Int |
AP Channel bandwidth is 320 MHZ |
| static Int |
AP Channel bandwidth is 40 MHZ |
| static Int |
AP Channel bandwidth is 80 MHZ |
| static Int |
AP Channel bandwidth is 160 MHZ, but 80MHZ + 80MHZ |
| static Int |
Preamble type: EHT. |
| static Int |
Preamble type: HE. |
| static Int |
Preamble type: HT. |
| static Int |
Preamble type: Legacy. |
| static Int |
Preamble type: VHT. |
| static Int |
The unspecified value. |
| static Int |
Wi-Fi 2. |
| static Int |
Wi-Fi 5 GHz band. |
| static Int |
Wi-Fi 60 GHz band. |
| static Int |
Wi-Fi 6 GHz band. |
| static Int |
Wi-Fi 802. |
| static Int |
Wi-Fi 802. |
| static Int |
Wi-Fi 802. |
| static Int |
Wi-Fi 802. |
| static Int |
Wi-Fi 802. |
| static Int |
Wi-Fi 802. |
| static Int |
Wi-Fi unknown standard |
| Inherited constants | |
|---|---|
| Public constructors | |
|---|---|
|
Construct an empty scan result. |
|
ScanResult(source: ScanResult)copy constructor |
|
| Public methods | |
|---|---|
| static Int |
convertChannelToFrequencyMhzIfSupported(channel: Int, band: Int)Utility function to convert Wi-Fi channel number to frequency in MHz. |
| static Int |
convertFrequencyMhzToChannelIfSupported(freqMhz: Int)Utility function to convert frequency in MHz to channel number. |
| Int |
Implement the Parcelable interface |
| MutableList<MloLink!> |
Return the Multi-Link Operation (MLO) affiliated Links for Wi-Fi 7 access points. |
| MacAddress? |
Return the access point Multi-Link Device (MLD) MAC Address for Wi-Fi 7 access points. |
| Int |
Return the access point Multi-Link Operation (MLO) link-id for Wi-Fi 7 access points. |
| MutableList<ScanResult.InformationElement!> |
Get all information elements found in the beacon. |
| IntArray |
Get all the security types supported by this ScanResult. |
| WifiSsid? |
The SSID of the access point. |
| Int |
return the AP wifi standard. |
| Boolean | |
| Boolean | |
| Boolean | |
| Boolean |
Returns whether the AP requires frame protection for ranging measurement. |
| Boolean |
Returns whether the AP supports secure HE-LTF for ranging measurement. |
| Boolean | |
| String |
toString()Returns a string representation of the object. |
| Unit |
writeToParcel(dest: Parcel, flags: Int)Implement the Parcelable interface |
| Properties | |
|---|---|
| String! |
The address of the access point. |
| static Parcelable.Creator<ScanResult!> |
Implement the Parcelable interface |
| String! |
The network name. |
| String! |
Describes the authentication, key management, and encryption schemes supported by the access point. |
| Int |
Not used if the AP bandwidth is 20 MHz If the AP use 40, 80, 160 or 320MHz, this is the center frequency (in MHz) if the AP use 80 + 80 MHz, this is the center frequency of the first segment (in MHz) |
| Int |
Only used if the AP bandwidth is 80 + 80 MHz if the AP use 80 + 80 MHz, this is the center frequency of the second segment (in MHz) |
| Int |
AP Channel bandwidth; one of |
| Int |
The center frequency of the primary 20 MHz frequency (in MHz) of the channel over which the client is communicating with the access point. |
| Int |
The detected signal level in dBm, also known as the RSSI. |
| CharSequence! |
Indicates Passpoint operator name published by access point. |
| Long |
timestamp in microseconds (since boot) when this result was last seen. |
| CharSequence! |
Indicates venue name (such as 'San Francisco Airport') published by access point; only available on Passpoint network and if published by access point. |
Constants
CHANNEL_WIDTH_160MHZ
static val CHANNEL_WIDTH_160MHZ: Int
AP Channel bandwidth is 160 MHZ
Value: 3CHANNEL_WIDTH_20MHZ
static val CHANNEL_WIDTH_20MHZ: Int
AP Channel bandwidth is 20 MHZ
Value: 0CHANNEL_WIDTH_320MHZ
static val CHANNEL_WIDTH_320MHZ: Int
AP Channel bandwidth is 320 MHZ
Value: 5CHANNEL_WIDTH_40MHZ
static val CHANNEL_WIDTH_40MHZ: Int
AP Channel bandwidth is 40 MHZ
Value: 1CHANNEL_WIDTH_80MHZ
static val CHANNEL_WIDTH_80MHZ: Int
AP Channel bandwidth is 80 MHZ
Value: 2CHANNEL_WIDTH_80MHZ_PLUS_MHZ
static val CHANNEL_WIDTH_80MHZ_PLUS_MHZ: Int
AP Channel bandwidth is 160 MHZ, but 80MHZ + 80MHZ
Value: 4PREAMBLE_LEGACY
static val PREAMBLE_LEGACY: Int
Preamble type: Legacy.
Value: 0WIFI_BAND_24_GHZ
static val WIFI_BAND_24_GHZ: Int
Wi-Fi 2.4 GHz band.
Value: 1WIFI_BAND_60_GHZ
static val WIFI_BAND_60_GHZ: Int
Wi-Fi 60 GHz band.
Value: 16WIFI_STANDARD_LEGACY
static val WIFI_STANDARD_LEGACY: Int
Wi-Fi 802.11a/b/g
Value: 1WIFI_STANDARD_UNKNOWN
static val WIFI_STANDARD_UNKNOWN: Int
Wi-Fi unknown standard
Value: 0Public constructors
ScanResult
ScanResult(source: ScanResult)
copy constructor
| Parameters | |
|---|---|
source |
ScanResult: This value cannot be null. |
Public methods
convertChannelToFrequencyMhzIfSupported
static fun convertChannelToFrequencyMhzIfSupported(
channel: Int,
band: Int
): Int
Utility function to convert Wi-Fi channel number to frequency in MHz. Reference the Wi-Fi channel numbering and the channelization in IEEE 802.11-2016 specifications, section 17.3.8.4.2, 17.3.8.4.3 and Table 15-6. See also convertFrequencyMhzToChannelIfSupported(int).
| Parameters | |
|---|---|
channel |
Int: number to convert. |
band |
Int: of channel to convert. One of the following bands: WIFI_BAND_24_GHZ, WIFI_BAND_5_GHZ, WIFI_BAND_6_GHZ, WIFI_BAND_60_GHZ. Value is one of the following: |
| Return | |
|---|---|
Int |
center frequency in Mhz of the channel, UNSPECIFIED if no match |
convertFrequencyMhzToChannelIfSupported
static fun convertFrequencyMhzToChannelIfSupported(freqMhz: Int): Int
Utility function to convert frequency in MHz to channel number. See also convertChannelToFrequencyMhzIfSupported(int,int).
| Parameters | |
|---|---|
freqMhz |
Int: frequency in MHz |
| Return | |
|---|---|
Int |
channel number associated with given frequency, UNSPECIFIED if no match |
describeContents
fun describeContents(): Int
Implement the Parcelable interface
| Return | |
|---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or
|
getAffiliatedMloLinks
fun getAffiliatedMloLinks(): MutableList<MloLink!>
Return the Multi-Link Operation (MLO) affiliated Links for Wi-Fi 7 access points. i.e. when getWifiStandard() returns WIFI_STANDARD_11BE.
| Return | |
|---|---|
MutableList<MloLink!> |
List of affiliated MLO links, or an empty list if access point is not Wi-Fi 7. This value cannot be null. |
getApMldMacAddress
fun getApMldMacAddress(): MacAddress?
Return the access point Multi-Link Device (MLD) MAC Address for Wi-Fi 7 access points. i.e. getWifiStandard() returns WIFI_STANDARD_11BE.
| Return | |
|---|---|
MacAddress? |
MLD MAC Address for access point if exists (Wi-Fi 7 access points), null otherwise. |
getApMloLinkId
fun getApMloLinkId(): Int
Return the access point Multi-Link Operation (MLO) link-id for Wi-Fi 7 access points. i.e. when getWifiStandard() returns WIFI_STANDARD_11BE, otherwise return MloLink.INVALID_MLO_LINK_ID. Valid values are 0-15 as described in IEEE 802.11be Specification, section 9.4.2.295b.2.
| Return | |
|---|---|
Int |
MloLink.INVALID_MLO_LINK_ID or a valid value (0-15). Value is between android.net.wifi.MloLink#INVALID_MLO_LINK_ID and android.net.wifi.MloLink#MAX_MLO_LINK_ID inclusive |
getInformationElements
fun getInformationElements(): MutableList<ScanResult.InformationElement!>
Get all information elements found in the beacon.
| Return | |
|---|---|
MutableList<ScanResult.InformationElement!> |
This value cannot be null. |
getSecurityTypes
fun getSecurityTypes(): IntArray
Get all the security types supported by this ScanResult.
getWifiSsid
fun getWifiSsid(): WifiSsid?
The SSID of the access point.
| Return | |
|---|---|
WifiSsid? |
This value may be null. |
getWifiStandard
fun getWifiStandard(): Int
return the AP wifi standard.
| Return | |
|---|---|
Int |
Value is one of the following: |