public
class
WifiInfo
extends Object
implements
Parcelable
java.lang.Object | |
↳ | android.net.wifi.WifiInfo |
Describes the state of any Wifi connection that is active or is in the process of being set up.
Constants | |
---|---|
String |
FREQUENCY_UNITS
Frequency in MHz |
String |
LINK_SPEED_UNITS
Link speed in Mbps |
Inherited constants |
---|
From
interface
android.os.Parcelable
|
Public methods | |
---|---|
String
|
getBSSID()
Return the basic service set identifier (BSSID) of the current access point. |
static
NetworkInfo.DetailedState
|
getDetailedStateOf(SupplicantState suppState)
Map a supplicant state into a fine-grained network connectivity state. |
int
|
getFrequency()
Returns the current frequency in |
boolean
|
getHiddenSSID()
|
int
|
getIpAddress()
|
int
|
getLinkSpeed()
Returns the current link speed in |
String
|
getMacAddress()
|
int
|
getNetworkId()
Each configured network has a unique small integer ID, used to identify the network when performing operations on the supplicant. |
int
|
getRssi()
Returns the received signal strength indicator of the current 802.11 network, in dBm. |
String
|
getSSID()
Returns the service set identifier (SSID) of the current 802.11 network. |
SupplicantState
|
getSupplicantState()
Return the detailed state of the supplicant's negotiation with an
access point, in the form of a |
String
|
toString()
Returns a string representation of the object. |
Inherited methods | |
---|---|
From
class
java.lang.Object
| |
From
interface
android.os.Parcelable
|
String LINK_SPEED_UNITS
Link speed in Mbps
Constant Value: "Mbps"
String getBSSID ()
Return the basic service set identifier (BSSID) of the current access point.
The BSSID may be null
if there is no network currently connected.
Returns | |
---|---|
String |
the BSSID, in the form of a six-byte MAC address: XX:XX:XX:XX:XX:XX
|
NetworkInfo.DetailedState getDetailedStateOf (SupplicantState suppState)
Map a supplicant state into a fine-grained network connectivity state.
Parameters | |
---|---|
suppState |
SupplicantState :
the supplicant state |
Returns | |
---|---|
NetworkInfo.DetailedState |
the corresponding NetworkInfo.DetailedState
|
int getFrequency ()
Returns the current frequency in FREQUENCY_UNITS
.
Returns | |
---|---|
int |
the frequency. |
See also:
boolean getHiddenSSID ()
Returns | |
---|---|
boolean |
true if this network does not broadcast its SSID, so an
SSID-specific probe request must be used for scans.
|
int getLinkSpeed ()
Returns the current link speed in LINK_SPEED_UNITS
.
Returns | |
---|---|
int |
the link speed. |
See also:
int getNetworkId ()
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.
Returns | |
---|---|
int |
the network ID, or -1 if there is no currently connected network |
int getRssi ()
Returns the received signal strength indicator of the current 802.11 network, in dBm.
Use calculateSignalLevel(int, int)
to convert this number into
an absolute signal level which can be displayed to a user.
Returns | |
---|---|
int |
the RSSI. |
String getSSID ()
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.
Returns | |
---|---|
String |
the SSID |
SupplicantState getSupplicantState ()
Return the detailed state of the supplicant's negotiation with an
access point, in the form of a SupplicantState
object.
Returns | |
---|---|
SupplicantState |
the current SupplicantState
|
String toString ()
Returns a string representation of the object. In general, the
toString
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())
Returns | |
---|---|
String |
a string representation of the object. |