public class DiscoveryHelper
extends java.lang.Object
Constructor and Description |
---|
DiscoveryHelper()
Construct a new DiscoveryHelper.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
discoverDevices(java.lang.String IPAddress,
java.lang.String discoveryMethod)
Discover all devices that reply to a ping on the class-C local
area network connected to the given IP address
A class-C network has a netmask of /24, or 255.255.255.0.
|
java.lang.String |
getHostAddress()
Return the IP address of the host machine.
|
java.lang.String |
getMacAddress()
Get the MAC (Media Access Control) address
of the first non-loopback, non-multicast address.
|
public java.lang.String discoverDevices(java.lang.String IPAddress, java.lang.String discoveryMethod)
IPAddress
- The IP address whose subnet should be scanned. E.g.,
for IP address 192.168.5.7, scan 192.168.5.0 to 192.168.5.255.discoveryMethod
- The discovery method to be used, e.g. nmap.public java.lang.String getHostAddress()
public java.lang.String getMacAddress() throws java.net.SocketException
java.net.SocketException
- If thrown while finding the address.