public interface FirmwareUpdaterLinkOs
Modifier and Type | Method and Description |
---|---|
void |
updateFirmware(String firmwareFilePath,
FirmwareUpdateHandler handler)
Update firmware on the printer using the default timeout of 7 minutes.
|
void |
updateFirmware(String firmwareFilePath,
long timeout,
FirmwareUpdateHandler handler)
Update firmware on the printer using the specified
timeout . |
void |
updateFirmwareUnconditionally(String firmwareFilePath,
FirmwareUpdateHandler handler)
Update firmware on the printer, using the default timeout of 7 minutes, regardless of the firmware version
currently on the printer.
|
void |
updateFirmwareUnconditionally(String firmwareFilePath,
long timeout,
FirmwareUpdateHandler handler)
Update firmware on the printer, using the specified
timeout , regardless of the firmware version
currently on the printer. |
void updateFirmware(String firmwareFilePath, FirmwareUpdateHandler handler) throws ConnectionException, ZebraPrinterLanguageUnknownException, ZebraIllegalArgumentException, DiscoveryException, java.util.concurrent.TimeoutException, java.io.FileNotFoundException
package test.zebra.sdk.printer.examples;
import com.zebra.sdk.comm.Connection;
import com.zebra.sdk.comm.TcpConnection;
import com.zebra.sdk.printer.FirmwareUpdateHandler;
import com.zebra.sdk.printer.ZebraPrinterFactory;
import com.zebra.sdk.printer.ZebraPrinterLinkOs;
public class UpdatePrinterFirmwareExample {
public static void main(String[] args) throws Exception {
String theIpAddress = "1.2.3.4";
// File path, e.g. "D:\\ZV68_19_6Z.zpl"
final String firmwareFilePath = "fullPathToFirmwareFile";
Connection connection = new TcpConnection(theIpAddress, TcpConnection.DEFAULT_ZPL_TCP_PORT);
try {
connection.open();
ZebraPrinterLinkOs p = ZebraPrinterFactory.getLinkOsPrinter(connection);
// Send the firmware file to the printer.
p.updateFirmware(firmwareFilePath, new FirmwareUpdateHandler() {
public void progressUpdate(int bytesWritten, int totalBytes) {
}
public void firmwareDownloadComplete() {
System.out.println("Firmware download complete");
}
public void printerOnline(ZebraPrinterLinkOs printer, String firmwareVersion) {
System.out.println("Printer online with firmware version=" + firmwareVersion);
}
});
} catch (Exception e) {
e.printStackTrace();
} finally {
connection.close();
}
}
}
firmwareFilePath
- File path of firmware filehandler
- callback for firmware updating statusConnectionException
- if the connection can not be opened, is closed prematurely, or connection cannot be
established after firmware download is complete.ZebraPrinterLanguageUnknownException
- if the printer language can not be determinedZebraIllegalArgumentException
- if an invalid firmware file is specified for the printerDiscoveryException
- if an error occurs while waiting for the printer to come back onlinejava.util.concurrent.TimeoutException
- if the maximum timeout is reached prior to the printer coming back online with the new
firmwarejava.io.FileNotFoundException
- Firmware file not foundvoid updateFirmware(String firmwareFilePath, long timeout, FirmwareUpdateHandler handler) throws ConnectionException, ZebraPrinterLanguageUnknownException, ZebraIllegalArgumentException, DiscoveryException, java.util.concurrent.TimeoutException, java.io.FileNotFoundException
timeout
. If the firmware currently on the printer
has the same version number as the firmware file, the firmware will not be sent to the printer.firmwareFilePath
- File path of firmware filetimeout
- Timeout in milliseconds. The minimum allowed timeout is 5 minutes (300000ms) due to the need to
reset the printer after flashing the firmware. If a timeout value less than the minimum is provided, the minimum
will be used instead.handler
- callback for firmware updating statusConnectionException
- if the connection can not be opened, is closed prematurely, or connection cannot be
established after firmware download is complete.ZebraPrinterLanguageUnknownException
- if the printer language can not be determinedZebraIllegalArgumentException
- if an invalid firmware file is specified for the printerDiscoveryException
- if an error occurs while waiting for the printer to come back onlinejava.util.concurrent.TimeoutException
- if the maximum timeout is reached prior to the printer coming back online with the new
firmwarejava.io.FileNotFoundException
- Firmware file not foundvoid updateFirmwareUnconditionally(String firmwareFilePath, FirmwareUpdateHandler handler) throws ConnectionException, ZebraPrinterLanguageUnknownException, ZebraIllegalArgumentException, DiscoveryException, java.util.concurrent.TimeoutException, java.io.FileNotFoundException
firmwareFilePath
- File path of firmware filehandler
- callback for firmware updating statusConnectionException
- if the connection can not be opened, is closed prematurely, or connection cannot be
established after firmware download is complete.ZebraPrinterLanguageUnknownException
- if the printer language can not be determinedZebraIllegalArgumentException
- if an invalid firmware file is specified for the printerDiscoveryException
- if an error occurs while waiting for the printer to come back onlinejava.util.concurrent.TimeoutException
- if the maximum timeout is reached prior to the printer coming back online with the new
firmwarejava.io.FileNotFoundException
- Firmware file not foundvoid updateFirmwareUnconditionally(String firmwareFilePath, long timeout, FirmwareUpdateHandler handler) throws ConnectionException, ZebraPrinterLanguageUnknownException, ZebraIllegalArgumentException, DiscoveryException, java.util.concurrent.TimeoutException, java.io.FileNotFoundException
timeout
, regardless of the firmware version
currently on the printer.firmwareFilePath
- File path of firmware filetimeout
- Timeout in milliseconds. The minimum allowed timeout is 5 minutes (300000ms) due to the need to
reset the printer after flashing the firmware. If a timeout value less than the minimum is provided, the minimum
will be used instead.handler
- callback for firmware updating statusConnectionException
- if the connection can not be opened, is closed prematurely, or connection cannot be
established after firmware download is complete.ZebraPrinterLanguageUnknownException
- if the printer language can not be determinedZebraIllegalArgumentException
- if an invalid firmware file is specified for the printerDiscoveryException
- if an error occurs while waiting for the printer to come back onlinejava.util.concurrent.TimeoutException
- if the maximum timeout is reached prior to the printer coming back online with the new
firmwarejava.io.FileNotFoundException
- Firmware file not found
© 2017 ZIH Corp. All Rights Reserved.