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 | |
---|---|
ScanResult(source: ScanResult) copy constructor |
|
Construct an empty scan result. |
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 {@hide} |
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 | |
String |
toString() |
Unit |
writeToParcel(dest: Parcel, flags: Int) Implement the Parcelable interface {@hide} |
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: 3
CHANNEL_WIDTH_20MHZ
static val CHANNEL_WIDTH_20MHZ: Int
AP Channel bandwidth is 20 MHZ
Value: 0
CHANNEL_WIDTH_320MHZ
static val CHANNEL_WIDTH_320MHZ: Int
AP Channel bandwidth is 320 MHZ
Value: 5
CHANNEL_WIDTH_40MHZ
static val CHANNEL_WIDTH_40MHZ: Int
AP Channel bandwidth is 40 MHZ
Value: 1
CHANNEL_WIDTH_80MHZ
static val CHANNEL_WIDTH_80MHZ: Int
AP Channel bandwidth is 80 MHZ
Value: 2
CHANNEL_WIDTH_80MHZ_PLUS_MHZ
static val CHANNEL_WIDTH_80MHZ_PLUS_MHZ: Int
AP Channel bandwidth is 160 MHZ, but 80MHZ + 80MHZ
Value: 4
PREAMBLE_LEGACY
static val PREAMBLE_LEGACY: Int
Preamble type: Legacy.
Value: 0
WIFI_BAND_24_GHZ
static val WIFI_BAND_24_GHZ: Int
Wi-Fi 2.4 GHz band.
Value: 1
WIFI_BAND_60_GHZ
static val WIFI_BAND_60_GHZ: Int
Wi-Fi 60 GHz band.
Value: 16
WIFI_STANDARD_LEGACY
static val WIFI_STANDARD_LEGACY: Int
Wi-Fi 802.11a/b/g
Value: 1
WIFI_STANDARD_UNKNOWN
static val WIFI_STANDARD_UNKNOWN: Int
Wi-Fi unknown standard
Value: 0
Public 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 android.net.wifi.ScanResult#UNSPECIFIED , android.net.wifi.ScanResult#WIFI_BAND_24_GHZ , android.net.wifi.ScanResult#WIFI_BAND_5_GHZ , android.net.wifi.ScanResult#WIFI_BAND_6_GHZ , or android.net.wifi.ScanResult#WIFI_BAND_60_GHZ |
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 {@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 |
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 MloLink.INVALID_MLO_LINK_ID and 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.
is80211azNtbResponder
fun is80211azNtbResponder(): Boolean
Return | |
---|---|
Boolean |
whether AP is a IEEE802.11az Non-Trigger based Ranging Responder. |
isTwtResponder
fun isTwtResponder(): Boolean
Return | |
---|---|
Boolean |
whether AP is Target Wake Time (TWT) Responder. |
toString
fun toString(): String
Return | |
---|---|
String |
a string representation of the object. |
writeToParcel
fun writeToParcel(
dest: Parcel,
flags: Int
): Unit
Implement the Parcelable interface {@hide}
Parameters | |
---|---|
dest |
Parcel: The Parcel in which the object should be written. This value cannot be null . |
flags |
Int: 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 |
Properties
CREATOR
static val CREATOR: Parcelable.Creator<ScanResult!>
Implement the Parcelable interface
capabilities
var capabilities: String!
Describes the authentication, key management, and encryption schemes supported by the access point.
centerFreq0
var centerFreq0: 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)
centerFreq1
var centerFreq1: 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)
channelWidth
var channelWidth: Int
AP Channel bandwidth; one of CHANNEL_WIDTH_20MHZ
, CHANNEL_WIDTH_40MHZ
, CHANNEL_WIDTH_80MHZ
, CHANNEL_WIDTH_160MHZ
, CHANNEL_WIDTH_320MHZ
, or CHANNEL_WIDTH_80MHZ_PLUS_MHZ
, or CHANNEL_WIDTH_320MHZ
Value is android.net.wifi.ScanResult#CHANNEL_WIDTH_20MHZ
, android.net.wifi.ScanResult#CHANNEL_WIDTH_40MHZ
, android.net.wifi.ScanResult#CHANNEL_WIDTH_80MHZ
, android.net.wifi.ScanResult#CHANNEL_WIDTH_160MHZ
, android.net.wifi.ScanResult#CHANNEL_WIDTH_80MHZ_PLUS_MHZ
, or android.net.wifi.ScanResult#CHANNEL_WIDTH_320MHZ
frequency
var frequency: 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.
level
var level: Int
The detected signal level in dBm, also known as the RSSI.
Use android.net.wifi.WifiManager#calculateSignalLevel to convert this number into an absolute signal level which can be displayed to a user.
operatorFriendlyName
varoperatorFriendlyName: CharSequence!
Deprecated: - Use WifiInfo#getPasspointProviderFriendlyName()
Indicates Passpoint operator name published by access point.
timestamp
var timestamp: Long
timestamp in microseconds (since boot) when this result was last seen.
venueName
varvenueName: CharSequence!
Deprecated: - This information is not provided
Indicates venue name (such as 'San Francisco Airport') published by access point; only available on Passpoint network and if published by access point.