public class UsbDiscoverer extends Object
package test.zebra.sdk.discovery.examples;
import com.zebra.sdk.comm.ConnectionException;
import com.zebra.sdk.printer.discovery.DiscoveredPrinterDriver;
import com.zebra.sdk.printer.discovery.DiscoveredUsbPrinter;
import com.zebra.sdk.printer.discovery.UsbDiscoverer;
public class UsbDiscovererExample {
public static void main(String[] args) {
try {
for (DiscoveredPrinterDriver printer : UsbDiscoverer.getZebraDriverPrinters()) {
System.out.println(printer);
}
for (DiscoveredUsbPrinter usbPrinter : UsbDiscoverer.getZebraUsbPrinters()) {
System.out.println(usbPrinter);
}
} 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 currently connected Zebra USB printers.
|
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.
© 2016 ZIH Corp. All Rights Reserved.