Package com.unitech.api.wlan
Class WlanCtrl
- java.lang.Object
-
- com.unitech.api.wlan.WlanCtrl
-
public class WlanCtrl extends java.lang.ObjectThe type Wlan ctrl.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBUNDLE_ENABLEDstatic java.lang.StringBUNDLE_ERROR_CODEstatic java.lang.StringBUNDLE_ERROR_MSGstatic intRESULT_CODE_ERRORstatic intRESULT_CODE_SUCCESS
-
Constructor Summary
Constructors Constructor Description WlanCtrl(android.content.Context context)Instantiates a new Wlan ctrl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description android.os.BundleconnectProfile(java.lang.String ssid)Connect profile bundle.android.os.BundledeleteProfile(java.lang.String ssid)Delete profile bundle.android.os.BundlegetConnectedProfile()Gets connected profile.android.os.BundlegetIpAssignmentProfile(java.lang.String ssid)ToDo: getIpAssignmentProfile no readyandroid.os.BundlegetProxyProfile(java.lang.String ssid)ToDo: only run in PA760, A9 and A10android.os.BundlegetWifiProfile(java.lang.String ssid)Get wifi profile.android.os.BundlegetWifiRandomizedMacStatus(java.lang.String ssid)Get Wifi Randomized MAC Statusandroid.os.BundleisProfileExisted(java.lang.String ssid)Is profile existed bundle.android.os.BundleisProfilesEmpty()Is profiles empty bundle.android.os.BundleremoveAllProfiles()Remove all profiles bundle.android.os.BundlesetCaptivePortalHttpsUrl(java.lang.String url)Set the URL used for HTTPS captive portal detection upon a new connection.android.os.BundlesetCaptivePortalHttpUrl(java.lang.String url)Set the URL used for HTTP captive portal detection upon a new connection.android.os.BundlesetCaptivePortalMode(int mode)Set captive portal detection mode to the specific modeandroid.os.BundlesetCaptivePortalUseHttps(int mode)Whether to use HTTPS for network validation.android.os.BundlesetIpAssignmentProfile(java.lang.String ssid, int ipAssignment, java.lang.String ipAddress, int prefixLength, java.lang.String gateway, java.lang.String dns1, java.lang.String dns2)Set ip assignment profile.android.os.BundlesetProxyProfile(java.lang.String ssid, int proxySetting, java.lang.String pacUrl, java.lang.String host, int port, java.lang.String excList)Sets proxy profile.android.os.BundlesetWifiAdapter(boolean enabled)Set WifiAdapter Switchandroid.os.BundlesetWifiEnterpriseProfile(java.lang.String ssid, java.lang.String certPath, java.lang.String identity, java.lang.String password)Set Wifi Enterprise Profileandroid.os.BundlesetWifiProfile(java.lang.String ssid, java.lang.String password, int securityMode)Set wifi profile.android.os.BundlesetWifiRandomizedMac(java.lang.String ssid, boolean enabled)Set WiFi Randomized MAC Need to reconnect specific WiFi
-
-
-
Field Detail
-
BUNDLE_ERROR_CODE
public static final java.lang.String BUNDLE_ERROR_CODE
- See Also:
- Constant Field Values
-
BUNDLE_ERROR_MSG
public static final java.lang.String BUNDLE_ERROR_MSG
- See Also:
- Constant Field Values
-
BUNDLE_ENABLED
public static final java.lang.String BUNDLE_ENABLED
- See Also:
- Constant Field Values
-
RESULT_CODE_ERROR
public static final int RESULT_CODE_ERROR
- See Also:
- Constant Field Values
-
RESULT_CODE_SUCCESS
public static final int RESULT_CODE_SUCCESS
- See Also:
- Constant Field Values
-
-
Method Detail
-
setWifiProfile
public android.os.Bundle setWifiProfile(java.lang.String ssid, java.lang.String password, int securityMode)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
public android.os.Bundle getWifiProfile(java.lang.String ssid)
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 android.os.Bundle setIpAssignmentProfile(java.lang.String ssid, int ipAssignment, java.lang.String ipAddress, int prefixLength, java.lang.String gateway, java.lang.String dns1, java.lang.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 erroeCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
getIpAssignmentProfile
public android.os.Bundle getIpAssignmentProfile(java.lang.String ssid)
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 android.os.Bundle setProxyProfile(java.lang.String ssid, int proxySetting, java.lang.String pacUrl, java.lang.String host, int port, java.lang.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 erroeCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
getProxyProfile
public android.os.Bundle getProxyProfile(java.lang.String ssid)
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 erroeCode = 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
public android.os.Bundle deleteProfile(java.lang.String ssid)
Delete profile bundle.- Parameters:
ssid- the ssid (String)- Returns:
- A bundle contains the error code and message
int erroeCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
isProfileExisted
public android.os.Bundle isProfileExisted(java.lang.String ssid)
Is profile existed bundle.- Parameters:
ssid- the ssid (String)- Returns:
- A bundle contains the error code and message
int erroeCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
connectProfile
public android.os.Bundle connectProfile(java.lang.String ssid)
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 android.os.Bundle getConnectedProfile()
Gets connected profile.- Returns:
- A bundle contains the error code and message
int erroeCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
String Ssid = bundle.getString("ssid");
-
removeAllProfiles
public android.os.Bundle removeAllProfiles()
Remove all profiles bundle.- Returns:
- A bundle contains the error code and message
int erroeCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
isProfilesEmpty
public android.os.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 android.os.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 erroeCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
setCaptivePortalHttpUrl
public android.os.Bundle setCaptivePortalHttpUrl(java.lang.String url)
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 erroeCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
setCaptivePortalUseHttps
public android.os.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 erroeCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
setCaptivePortalHttpsUrl
public android.os.Bundle setCaptivePortalHttpsUrl(java.lang.String url)
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 erroeCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
setWifiAdapter
public android.os.Bundle setWifiAdapter(boolean enabled)
Set WifiAdapter Switch- Parameters:
enabled- , true or false (boolean)- Returns:
- A bundle contains the error code and message
int erroeCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
setWifiEnterpriseProfile
public android.os.Bundle setWifiEnterpriseProfile(java.lang.String ssid, java.lang.String certPath, java.lang.String identity, java.lang.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 erroeCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
getWifiRandomizedMacStatus
public android.os.Bundle getWifiRandomizedMacStatus(java.lang.String ssid)
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
public android.os.Bundle setWifiRandomizedMac(java.lang.String ssid, boolean enabled)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");
-
-