Class EthernetCtrl

java.lang.Object
com.unitech.api.ethernet.EthernetCtrl

public class EthernetCtrl extends Object
The type Ethernet ctrl.
  • Field Details

  • Constructor Details

    • EthernetCtrl

      public EthernetCtrl(Context context)
      Instantiates a new Ethernet ctrl.
      Parameters:
      context - the context
  • Method Details

    • setProperty

      public Bundle setProperty(String name, int ipAssignment, String ipAddress, int prefixLength, String gateway, String dns1, String dns2)
      set Ethernet Interface property.
      Parameters:
      name - the interface name (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");
    • getProperty

      public Bundle getProperty(String name)
      get Ethernet Interface property
      Parameters:
      name - the interface name
      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");
    • getAvailableInterfaces

      public Bundle getAvailableInterfaces()
      Get Ethernet Available Interfaces
      Returns:
      A bundle contains the error code and message
      int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
      String errorMsg=bundle.getString("errorMsg");
      String[] interfaces = bundle.getStringArray("interfaces");