Package com.unitech.api.ethernet
Class EthernetCtrl
java.lang.Object
com.unitech.api.ethernet.EthernetCtrl
The type Ethernet ctrl.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBundleGet Ethernet Available InterfacesBundlegetProperty(String name) get Ethernet Interface propertyBundlesetProperty(String name, int ipAssignment, String ipAddress, int prefixLength, String gateway, String dns1, String dns2) set Ethernet Interface property.
-
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
-
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
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");
-