Sequenceablepublic final class WifiScanInfo extends Object implements Sequenceable
This class provides the methods to store and convert the obtained Wi-Fi access point, and obtain its detailed information.
Sequenceable.Producer<T>| 限定符和类型 | 方法 | 说明 |
|---|---|---|
int |
getBand() |
Obtains the frequency band of a Wi-Fi access point.
|
int |
getBandWidth() |
Obtains the bandwidth of a Wi-Fi access point.
|
String |
getBssid() |
Obtains the BSSID of a Wi-Fi access point.
|
String |
getCapabilities() |
Obtains the capabilities of a Wi-Fi access point.
|
int[] |
getCenterFrequencies() |
Obtains the center frequencies of a hotspot that uses a WLAN channel with a width of 40 MHz,
80 MHz, or 160 MHz, or uses two non-overlapping WLAN channels, both with a width of 80 MHz.
|
int |
getFrequency() |
Obtains the center frequency of a hotspot that uses a WLAN channel with a width of 20 MHz
|
Map<Integer,byte[]> |
getInformationElements() |
Obtains the information elements in the beacon.
|
int |
getRssi() |
Obtains the RSSI of a Wi-Fi access point.
|
int |
getSecurityType() |
Obtains the encryption mode of a Wi-Fi access point.
|
String |
getSsid() |
Obtains the SSID of a Wi-Fi access point.
|
long |
getTimestamp() |
Obtains the timestamp of the latest detection of a Wi-Fi hotspot.
|
boolean |
marshalling(Parcel out) |
Writes a
Sequenceable object into a Parcel for scan info. |
String |
toString() |
Returns a string representation of the object.
|
boolean |
unmarshalling(Parcel in) |
Restores a
Sequenceable object from a Parcel for scan info. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waithasFileDescriptorpublic boolean marshalling(Parcel out)
Sequenceable object into a Parcel for scan info.marshalling 在接口中 Sequenceableout - Indicates the Parcel object to which the Sequenceable
object will be written.true if the marshalling is successful; returns false otherwise.public boolean unmarshalling(Parcel in)
Sequenceable object from a Parcel for scan info.unmarshalling 在接口中 Sequenceablein - Indicates the Parcel object into which the Sequenceable
object has been written.true if the unmarshalling is successful; returns false otherwise.public String getSsid()
The SSID is in UTF-8 format.
A valid SSID must contain less than 32 ASCII characters.
public String getBssid()
BSSID represents the physical address of the Wi-Fi access point.
public String getCapabilities()
The capabilities include the verification information and encryption algorithms of the Wi-Fi access point.
The capabilities consist of a series of tags separated by [].
For example, [WPA2-EAP-CCMP][RSN-EAP-CCMP].
public int getSecurityType()
An example encryption mode is WifiSecurity#PSK.
WifiSecurity.PSKpublic int getRssi()
The unit of RSSI is dBm.
You can use the WifiDevice#getSignalLevel(int, int) method to obtain a clearer signal level.
public int getBand()
The frequency band can be 2.4 GHz WifiEvents#BAND_WIFI_2G or 5 GHz WifiEvents#BAND_WIFI_5G.
WifiEvents#BAND_INVALID
if the frequency band is invalid.public int getBandWidth()
Five bandwidth types are available:
WifiEvents#BAND_WIDTH_20MHZWifiEvents#BAND_WIDTH_40MHZWifiEvents#BAND_WIDTH_80MHZWifiEvents#BAND_WIDTH_160MHZWifiEvents#BAND_WIDTH_80MHZ_PLUSpublic int getFrequency()
public int[] getCenterFrequencies()
0;
returns two center frequencies if the hotspot uses two non-overlapping WLAN channels,
both with a width of 80 MHzpublic long getTimestamp()
The unit is ms.
public Map<Integer,byte[]> getInformationElements()
public String toString()
ObjecttoString method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())