Class WlanCtrl

java.lang.Object
com.unitech.api.wlan.WlanCtrl

public class WlanCtrl extends Object
The type Wlan ctrl.
  • Field Details

  • Constructor Details

    • WlanCtrl

      public WlanCtrl(android.content.Context context)
      Instantiates a new Wlan ctrl.
      Parameters:
      context - the context
  • Method Details

    • setWifiProfile

      public android.os.Bundle setWifiProfile(String ssid, 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(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(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

      public android.os.Bundle getIpAssignmentProfile(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(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

      public android.os.Bundle getProxyProfile(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 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

      public android.os.Bundle deleteProfile(String ssid)
      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

      public android.os.Bundle isProfileExisted(String ssid)
      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

      public android.os.Bundle connectProfile(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()
      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

      public android.os.Bundle setCaptivePortalHttpUrl(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 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

      public android.os.Bundle setCaptivePortalHttpsUrl(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 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

      public android.os.Bundle getWifiRandomizedMacStatus(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(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");
    • 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");