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 TypeMethodDescriptionandroid.os.BundleconnectProfile(String ssid) Connect profile bundle.android.os.BundledeleteProfile(String ssid) Delete profile bundle.android.os.BundleGet connected profile.android.os.BundlegetIpAssignmentProfile(String ssid) ToDo: getIpAssignmentProfile no readyandroid.os.BundlegetProxyProfile(String ssid) ToDo: only run in PA760, A9 and A10android.os.BundlegetWifiProfile(String ssid) Get wifi profile.android.os.BundleGet Wifi Randomized MAC Statusandroid.os.BundleGet WLAN Connect Stateandroid.os.BundleGet WLAN IP Addressandroid.os.BundleGet WLAN MAC Addressandroid.os.BundleGet WLAN Signal Strengthandroid.os.BundleisProfileExisted(String ssid) Is profile existed bundle.android.os.BundleIs profiles empty bundle.android.os.BundleRemove all profiles bundle.android.os.BundleSet the URL used for HTTPS captive portal detection upon a new connection.android.os.BundleSet 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(String ssid, int ipAssignment, String ipAddress, int prefixLength, String gateway, String dns1, String dns2) Set ip assignment profile.android.os.BundlesetProxyProfile(String ssid, int proxySetting, String pacUrl, String host, int port, String excList) Sets proxy profile.android.os.BundlesetWifiAdapter(boolean enabled) Set WifiAdapter Switchandroid.os.BundlesetWifiEnterpriseProfile(String ssid, String certPath, String identity, String password) Set Wifi Enterprise Profileandroid.os.BundlesetWifiHotSpotConfiguration(String ssid, String password, int securityMode, int band, boolean autoShutdown) Set Wifi HotSpot Configurationandroid.os.BundlesetWifiHotSpotEnable(boolean enabled) Enable or Disable Wifi HotSpotandroid.os.BundlesetWifiNetworkNotification(boolean enabled) Enable notify for public networkandroid.os.BundlesetWifiProfile(String ssid, String password, int securityMode) Set wifi profile.android.os.BundlesetWifiRandomizedMac(String ssid, boolean enabled) Set WiFi Randomized MAC Need to reconnect specific WiFiandroid.os.BundlesetWifiTurnOnAuto(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(android.content.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 android.os.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 android.os.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 android.os.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 android.os.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 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 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 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 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 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 errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
setWifiEnterpriseProfile
public android.os.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 android.os.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 android.os.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 android.os.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 android.os.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 android.os.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 android.os.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 android.os.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 android.os.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");
-