public class EthernetDiscoverer
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
EthernetDiscoverer.OnDataManDeviceDetectedListener
Interface definition for a callback to be invoked if a device is found.
|
| Constructor and Description |
|---|
EthernetDiscoverer(java.net.NetworkInterface ni,
android.os.Handler handler,
EthernetDiscoverer.OnDataManDeviceDetectedListener listener)
Creates an EthernetDiscoverer object on the specified
NetworkInterface |
| Modifier and Type | Method and Description |
|---|---|
int |
getDeviceFilter() |
void |
sendIdentifier()
Send identifier packet on the network.
|
void |
setDeviceFilter(int deviceFilter) |
void |
setLogger(com.cognex.dataman.sdk.Logger logger)
Sets the optional logger which can be used for debugging purposes.
|
void |
startDeviceDiscovery()
Starts the device discovery process.
|
void |
startDeviceDiscovery(boolean treatBootupAsHello)
Starts the device discovery process.
|
void |
stopDeviceDiscovery()
Cancels the currently running device discovery.
|
static EthernetDiscoverer |
wifiInterfaceDiscoverer(android.content.Context context,
EthernetDiscoverer.OnDataManDeviceDetectedListener listener)
Discovers available DataMan devices on the WiFi network, if available, and executes the listener on the main looper Handler.
|
static EthernetDiscoverer |
wifiInterfaceDiscoverer(android.content.Context context,
android.os.Handler handler,
EthernetDiscoverer.OnDataManDeviceDetectedListener listener)
Discovers available DataMan devices on the WiFi network, if available.
|
public EthernetDiscoverer(java.net.NetworkInterface ni,
android.os.Handler handler,
EthernetDiscoverer.OnDataManDeviceDetectedListener listener)
throws java.lang.IllegalArgumentException
NetworkInterfaceni - The NetworkInterface object to use for discovering the deviceshandler - The Handler object to be used to execute the listeners on its thread. (specify null for main looper Handler)listener - The EthernetDiscoverer.OnDataManDeviceDetectedListener listener to invoke if a device is found.java.lang.IllegalArgumentException - if no InterfaceAddress is available on the specified NetworkInterfacepublic static EthernetDiscoverer wifiInterfaceDiscoverer(android.content.Context context, android.os.Handler handler, EthernetDiscoverer.OnDataManDeviceDetectedListener listener)
context - The Context object to use.handler - The Handler object to be used to execute the listeners on its thread. (specify null for main looper Handler)listener - The EthernetDiscoverer.OnDataManDeviceDetectedListener listener to invoke if a device is found.public static EthernetDiscoverer wifiInterfaceDiscoverer(android.content.Context context, EthernetDiscoverer.OnDataManDeviceDetectedListener listener)
context - The Context object to use.listener - The EthernetDiscoverer.OnDataManDeviceDetectedListener listener to invoke if a device is found.public int getDeviceFilter()
public void setDeviceFilter(int deviceFilter)
public void startDeviceDiscovery()
throws java.lang.IllegalArgumentException,
java.lang.IllegalStateException
java.lang.IllegalArgumentException - if the interface can not be opened.java.lang.IllegalStateExceptionpublic void startDeviceDiscovery(boolean treatBootupAsHello)
throws java.lang.IllegalArgumentException,
java.lang.IllegalStateException
treatBootupAsHello - If true, the listener will treat Bootup packets as Hello packets when processing
incoming cognamer packets.java.lang.IllegalArgumentException - if the interface can not be opened.java.lang.IllegalStateExceptionpublic void sendIdentifier()
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionpublic void stopDeviceDiscovery()
public void setLogger(com.cognex.dataman.sdk.Logger logger)
logger - The logger object to be used for logging.