Package com.unitech.api.wlan
Class WlanCtrl
java.lang.Object
com.unitech.api.wlan.WlanCtrl
The type Wlan ctrl.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBundleconnectProfile(String ssid) Connect profile bundle.BundledeleteProfile(String ssid) Delete profile bundle.BundleGet connected profile.BundlegetIpAssignmentProfile(String ssid) ToDo: getIpAssignmentProfile no readyBundlegetProxyProfile(String ssid) ToDo: only run in PA760, A9 and A10BundlegetWifiProfile(String ssid) Get wifi profile.BundleGet Wifi Randomized MAC StatusBundleGet WLAN Connect StateBundleGet WLAN IP AddressBundleGet WLAN MAC AddressBundleGet WLAN Signal StrengthBundleisProfileExisted(String ssid) Is profile existed bundle.BundleIs profiles empty bundle.BundleRemove all profiles bundle.BundleSet the URL used for HTTPS captive portal detection upon a new connection.BundleSet the URL used for HTTP captive portal detection upon a new connection.BundlesetCaptivePortalMode(int mode) Set captive portal detection mode to the specific modeBundlesetCaptivePortalUseHttps(int mode) Whether to use HTTPS for network validation.BundlesetIpAssignmentProfile(String ssid, int ipAssignment, String ipAddress, int prefixLength, String gateway, String dns1, String dns2) Set ip assignment profile.BundlesetProxyProfile(String ssid, int proxySetting, String pacUrl, String host, int port, String excList) Sets proxy profile.BundlesetWifiAdapter(boolean enabled) Set WifiAdapter SwitchBundlesetWifiEnterpriseProfile(String ssid, String certPath, String identity, String password) Set Wifi Enterprise ProfileBundlesetWifiHotSpotConfiguration(String ssid, String password, int securityMode, int band, boolean autoShutdown) Set Wifi HotSpot ConfigurationBundlesetWifiHotSpotEnable(boolean enabled) Enable or Disable Wifi HotSpotBundlesetWifiNetworkNotification(boolean enabled) Enable notify for public networkBundlesetWifiProfile(String ssid, String password, int securityMode) Set wifi profile.BundlesetWifiRandomizedMac(String ssid, boolean enabled) Set WiFi Randomized MAC Need to reconnect specific WiFiBundlesetWifiTurnOnAuto(boolean enabled) Enable Turn on Wi-Fi automatically
-
Field Details
-
BUNDLE_ERROR_CODE
- See Also:
-
BUNDLE_ERROR_MSG
- See Also:
-
BUNDLE_ENABLED
- See Also:
-
RESULT_CODE_ERROR
public static final int RESULT_CODE_ERROR- See Also:
-
RESULT_CODE_SUCCESS
public static final int RESULT_CODE_SUCCESS- See Also:
-
-
Constructor Details
-
WlanCtrl
public WlanCtrl(Context context) Instantiates a new Wlan ctrl.- Parameters:
context- the context
-
-
Method Details
-
setWifiProfile
Set wifi profile.- Parameters:
ssid- the ssid (String)password- the password (String)securityMode- the security mode (int) (None:0, WEP:1, WPA:2)- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
getWifiProfile
Get wifi profile.- Parameters:
ssid- the ssid- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
int mode = bundle.putInt("SecurityMode");
(Only get SecurityMode, No password)(SecurityMode (int) (None:0, WEP:1, WPA:2))
-
setIpAssignmentProfile
public Bundle setIpAssignmentProfile(String ssid, int ipAssignment, String ipAddress, int prefixLength, String gateway, String dns1, String dns2) Set ip assignment profile.- Parameters:
ssid- the ssid (String)ipAssignment- the ip assignment (int) (DHCP:0 , STATIC:1) (If set DHCP, other parameters is invalid.)ipAddress- the ip address (String)prefixLength- the prefix length (int)gateway- the gateway (String)dns1- the dns 1 (String)dns2- the dns 2 (String)- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
getIpAssignmentProfile
ToDo: getIpAssignmentProfile no ready- Parameters:
ssid- the ssid- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
int IpAssignment = bundle.getInt("IpAssignment"); (DHCP:0 , STATIC:1)
String IpAddress = bundle.getString("IpAddress");
int PrefixLength = bundle.getInt("PrefixLength");
String Gateway = bundle.getString("Gateway");
String Dns1 = bundle.getString("Dns1");
String Dns2 = bundle.getString("Dns2");
-
setProxyProfile
public Bundle setProxyProfile(String ssid, int proxySetting, String pacUrl, String host, int port, String excList) Sets proxy profile.- Parameters:
ssid- the ssid (String)proxySetting- the proxy setting (None:0, Manual:1, Proxy Auto-Config:2)pacUrl- the pac url (String)host- the host (String)port- the port (int)excList- the exc list (String)- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
getProxyProfile
ToDo: only run in PA760, A9 and A10- Parameters:
ssid- the ssid (only run in PA760, A9 and A10)- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
int ProxySettings = bundle.getInt("ProxySettings"), (None:0, Manual:1, Proxy Auto-Config:2)
String PacFileUrl = bundle.getString("PacFileUrl");
String Host = bundle.getString("Host");
int Port = bundle.getInt("Port");
String ExcList = bundle.getString("ExcList");
-
deleteProfile
Delete profile bundle.- Parameters:
ssid- the ssid (String)- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
isProfileExisted
Is profile existed bundle.- Parameters:
ssid- the ssid (String)- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
connectProfile
Connect profile bundle.- Parameters:
ssid- the ssid (String)- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
getConnectedProfile
public Bundle getConnectedProfile()Get connected profile.- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
String Ssid = bundle.getString("ssid");
String bSsid = bundle.getString("bssid");
-
removeAllProfiles
public Bundle removeAllProfiles()Remove all profiles bundle.- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
isProfilesEmpty
public Bundle isProfilesEmpty()Is profiles empty bundle.- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
setCaptivePortalMode
public Bundle setCaptivePortalMode(int mode) Set captive portal detection mode to the specific mode- Parameters:
mode- Captive portal detection mode:
0: Don't attempt to detect captive portals
1: Prompt the user to sign in
2: Immediately disconnect from the network and do not reconnect to that network in the future- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
setCaptivePortalHttpUrl
Set the URL used for HTTP captive portal detection upon a new connection. A 204 response code from the server is used for validation.- Parameters:
url- The URL used for HTTP captive portal detection upon a new connection.- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
setCaptivePortalUseHttps
public Bundle setCaptivePortalUseHttps(int mode) Whether to use HTTPS for network validation. The setting needs to be set to 0 to disable it. This setting is a misnomer because captive portals don't actually use HTTPS, but it's consistent with the other settings.- Parameters:
mode- Whether to use HTTPS for network validation.
0: Use HTTP for network validation.
1: Use HTTPS for network validation.- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
setCaptivePortalHttpsUrl
Set the URL used for HTTPS captive portal detection upon a new connection. A 204 response code from the server is used for validation.- Parameters:
url- The URL used for HTTPS captive portal detection upon a new connection. A 204 response code from the server is used for validation.- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
setWifiAdapter
public Bundle setWifiAdapter(boolean enabled) Set WifiAdapter Switch- Parameters:
enabled- , true or false (boolean)- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
setWifiEnterpriseProfile
public Bundle setWifiEnterpriseProfile(String ssid, String certPath, String identity, String password) Set Wifi Enterprise Profile- Parameters:
ssid- , the ssid (String)certPath- , the cerPath (String)identity- , the identity (String)password- , the password (String)- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
getWifiRandomizedMacStatus
Get Wifi Randomized MAC Status- Parameters:
ssid- , the ssid (String)- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg"),
boolean enabled = bundle.getBoolean("enabled");
-
setWifiRandomizedMac
Set WiFi Randomized MAC Need to reconnect specific WiFi- Parameters:
ssid- , the ssid (String)enabled- , enable the WiFi randomize MAC or not (boolean)- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg"),
boolean enabled = bundle.getBoolean("enabled");
-
getWLANMACAddress
public Bundle getWLANMACAddress()Get WLAN MAC Address- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg=bundle.getString("errorMsg");
String getWLANMACAddress=bundle.getString("getWLANMACAddress");
-
getWLANIpAddress
public Bundle getWLANIpAddress()Get WLAN IP Address- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg=bundle.getString("errorMsg");
String getWLANIpAddress=bundle.getString("getWLANIpAddress");
-
getWLANSignalStrength
public Bundle getWLANSignalStrength()Get WLAN Signal Strength- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg=bundle.getString("errorMsg");
String getWLANSignalStrength=bundle.getString("getWLANSignalStrength");
-
getWLANConnectState
public Bundle getWLANConnectState()Get WLAN Connect State- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg=bundle.getString("errorMsg");
String getWLANConnectState=bundle.getString("getWLANConnectState");
-
setWifiTurnOnAuto
public Bundle setWifiTurnOnAuto(boolean enabled) Enable Turn on Wi-Fi automatically- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg=bundle.getString("errorMsg");
-
setWifiNetworkNotification
public Bundle setWifiNetworkNotification(boolean enabled) Enable notify for public network- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg=bundle.getString("errorMsg");
-
setWifiHotSpotEnable
public Bundle setWifiHotSpotEnable(boolean enabled) Enable or Disable Wifi HotSpot- Parameters:
enabled- , true or false (boolean)- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg=bundle.getString("errorMsg");
-
setWifiHotSpotConfiguration
public Bundle setWifiHotSpotConfiguration(String ssid, String password, int securityMode, int band, boolean autoShutdown) Set Wifi HotSpot Configuration- Parameters:
ssid- , the ssid (String)password- , the password (String, 8-63 characters)securityMode- , the security mode (int, 0:None, 1:WPA2-personal, 2:WPA2/WPA3-personal, 3:WPA3-personal)band- , the band (int, 1:2.4GHz, 2:5GHz)autoShutdown- , the auto shutdown (boolean)- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg=bundle.getString("errorMsg");
-