java.lang.Object | |
↳ | com.digi.android.ethernet.EthernetManager |
Class that handles the Ethernet connection and configuration.
Note that only one interface is supported.
Unless noted, all API methods require the
android.permission.ACCESS_NETWORK_STATE
and/or
android.permission.CHANGE_NETWORK_STATE
permissions, depending on whether you are accessing or changing the Ethernet
configuration. If your application does not have these permissions it will
not have access to any Ethernet service feature.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | TAG |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Class constructor.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Configures the interface with the given configuration.
| |||||||||||
Returns the configured connection mode of the interface.
| |||||||||||
Returns the configured DNS1 address of the interface.
| |||||||||||
Returns the configured DNS2 address of the interface.
| |||||||||||
Returns the configured gateway address of the interface.
| |||||||||||
Returns the Ethernet interface name.
| |||||||||||
Returns the configured IP address of the interface.
| |||||||||||
Reads the MAC address of the Ethernet interface.
| |||||||||||
Returns the configured netmask of the interface.
| |||||||||||
Returns whether the Ethernet interface is connected or not.
| |||||||||||
Returns whether the interface is enabled or not.
| |||||||||||
Resets the Ethernet interface.
| |||||||||||
Enables or disables the interface.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Class constructor. Creates a new instance of the EthernetManager
.
Parameters | |
---|---|
context |
Context : Application context. |
Throws | |
---|---|
NullPointerException |
If context == null .
|
Configures the interface with the given configuration.
This method resets the interface to apply the new configuration.
Parameters | |
---|---|
info |
EthernetConfiguration : Interface configuration. |
Throws | |
---|---|
IllegalArgumentException |
If the interface name is invalid or the connection mode is unknown. |
NullPointerException |
If info == null or
in a static configuration the IP, netmask,
gateway or DNS 1 addresses are null. |
UnknownHostException |
If the given IP addresses cannot be resolved. |
Returns the configured connection mode of the interface.
Returns | |
---|---|
EthernetConnectionMode |
The configured connection mode. |
Returns the configured DNS1 address of the interface.
Returns | |
---|---|
InetAddress |
The configured DNS1 address or null if could not be read. |
Returns the configured DNS2 address of the interface.
Returns | |
---|---|
InetAddress |
The configured DNS2 address or null if could not be read. |
Returns the configured gateway address of the interface.
Returns | |
---|---|
InetAddress |
The configured gateway address or null if could not be
read. |
Returns the Ethernet interface name.
Returns | |
---|---|
String |
The Ethernet interface name, null if there is not any
interface.
|
Returns the configured IP address of the interface.
Returns | |
---|---|
InetAddress |
The configured IP address or null if could not be read. |
Reads the MAC address of the Ethernet interface.
Returns | |
---|---|
String |
The MAC address or null if could not be read. |
Throws | |
---|---|
NullPointerException |
If the configured interface is null. |
Returns the configured netmask of the interface.
Returns | |
---|---|
InetAddress |
The configured netmask or null if could not be read. |
Returns whether the Ethernet interface is connected or not.
Returns | |
---|---|
boolean |
true if connected, false otherwise.
|
Returns whether the interface is enabled or not.
Returns | |
---|---|
boolean |
true if the interface is enabled, false
otherwise. |
See also:
Resets the Ethernet interface.
Enables or disables the interface.
Parameters | |
---|---|
enable |
boolean : true to enable, false to disable. |
See also: