Sequenceablepublic final class WifiDeviceConfig extends Object implements Sequenceable
Using this to connect to a Wi-Fi access point with specified configuration, including the SSID, encryption mode, and password.
Sequenceable.Producer<T>| 构造器 | 说明 |
|---|---|
WifiDeviceConfig() |
A constructor used to create a
WifiDeviceConfig instance with default parameters. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
String |
getBssid() |
Obtains the BSSID in the Wi-Fi configuration.
|
String |
getPreSharedKey() |
Obtains the password in the Wi-Fi configuration.
|
int |
getSecurityType() |
Obtains the encryption mode in the Wi-Fi configuration.
|
String |
getSsid() |
Obtains the SSID in the Wi-Fi configuration.
|
boolean |
isHiddenSsid() |
Checks whether the Wi-Fi access point broadcasts the SSID.
|
boolean |
isRestricted() |
Checks whether the data volume is not restricted in this network.
|
boolean |
marshalling(Parcel out) |
Writes a
Sequenceable object
into a Parcel for Wifi Device Config. |
void |
setHiddenSsid(boolean isHiddenSsid) |
Hides an SSID for a Wi-Fi access point.
|
void |
setPreSharedKey(String preSharedKey) |
Sets the password of a Wi-Fi access point.
|
void |
setRestricted(boolean isDataRestricted) |
Sets whether to restrict the data volume in this network.
|
void |
setSecurityType(int securityType) |
Sets the encryption mode of a Wi-Fi access point.
|
void |
setSsid(String ssid) |
Sets the SSID name of a Wi-Fi access point.
|
boolean |
unmarshalling(Parcel in) |
Restores a
Sequenceable object from a Parcel
for Wifi Device Config. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithasFileDescriptorpublic WifiDeviceConfig()
WifiDeviceConfig instance with default parameters.public boolean marshalling(Parcel out)
Sequenceable object
into a Parcel for Wifi Device Config.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 Wifi Device Config.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.
public void setSsid(String ssid)
The SSID must be in UTF-8 format and can contain a maximum of 32 characters.
ssid - Indicates the SSID name to be set.public String getBssid()
The BSSID is in XX:XX:XX:XX:XX:XX format.
null if BSSID is not configured.public String getPreSharedKey()
If PSK encryption is used, a password is mandatory.
public void setPreSharedKey(String preSharedKey)
If the PSK encryption mode is used, a password is mandatory.
Note: The password can only contain ASCII characters.
preSharedKey - Indicates the password of the Wi-Fi access point.public boolean isHiddenSsid()
During a Wi-Fi scanning, the SSID of a Wi-Fi access point that is not hidden is contained in the request frame.
true if a hidden SSID is configured; returns false otherwise.public void setHiddenSsid(boolean isHiddenSsid)
isHiddenSsid - Specifies whether to hide the SSID. The value true indicates
that the SSID is hidden, and the value false indicates that the SSID is not hidden.public int getSecurityType()
An example encryption mode is WifiSecurity#PSK.
WifiSecurity.PSKpublic void setSecurityType(int securityType)
If the PSK encryption mode is used, a password must be set using setPreSharedKey(java.lang.String).
securityType - Indicates the encryption mode to be set, such as WifiSecurity#PSK.WifiSecurity.PSKpublic boolean isRestricted()
true if the data volume is not restricted in this network;
returns false otherwise.public void setRestricted(boolean isDataRestricted)
isDataRestricted - Specifies whether to restrict the data volume in this network.
The value true indicates that the data volume is restricted,
and value false indicates that the data volume is not restricted.