public class UsbDiscoverer
extends Object
package test.zebra.sdk.discovery.examples;
import com.zebra.sdk.comm.ConnectionException;
import com.zebra.sdk.common.card.printer.discovery.ZebraCardPrinterFilter;
import com.zebra.sdk.printer.discovery.*;
public class UsbDiscovererExample {
public static void main(String[] args) {
try {
for (DiscoveredUsbPrinter printer : UsbDiscoverer.getZebraUsbPrinters(new ZebraCardPrinterFilter())) {
System.out.println(printer);
}
} catch (ConnectionException e) {
System.out.println("Error discovering local printers: " + e.getMessage());
}
System.out.println("Done discovering local printers.");
}
}
Constructor and Description |
---|
UsbDiscoverer()
A class used to discover USB connected Zebra printers.
|
Modifier and Type | Method and Description |
---|---|
static DiscoveredPrinterDriver[] |
getZebraDriverPrinters()
Enumerate locally installed Zebra Designer Drivers.
|
static DiscoveredUsbPrinter[] |
getZebraUsbPrinters()
Enumerate all currently connected Zebra USB printers.
|
static DiscoveredUsbPrinter[] |
getZebraUsbPrinters(DiscoveredPrinterFilter discoveredPrinterFilter)
Enumerate currently connected Zebra USB printers that meet the specified DiscoveredPrinterFilter criteria.
|
public UsbDiscoverer()
public static DiscoveredPrinterDriver[] getZebraDriverPrinters() throws ConnectionException
ConnectionException
- if the system is not running the Windows operating system.public static DiscoveredUsbPrinter[] getZebraUsbPrinters() throws ConnectionException
ConnectionException
- if the system is not running the Windows operating system.public static DiscoveredUsbPrinter[] getZebraUsbPrinters(DiscoveredPrinterFilter discoveredPrinterFilter) throws ConnectionException
discoveredPrinterFilter
- A custom DiscoveredPrinterFilter
instance
used to determine whether or not a discovered device should be ignored.ConnectionException
- if the system is not running the Windows operating system or an error occurs during
discovery.
© 2016 ZIH Corp. All Rights Reserved.