Package com.zebra.sdk.printer
Interface FirmwareUpdaterLinkOs
- All Known Subinterfaces:
ZebraPrinterLinkOs
public interface FirmwareUpdaterLinkOs
This is the interface for updating firmware on a Link-OS printer.
-
Method Summary
Modifier and TypeMethodDescriptionvoidupdateFirmware(String firmwareFilePath, long timeout, FirmwareUpdateHandler handler) Update firmware on the printer using the specifiedtimeout.voidupdateFirmware(String firmwareFilePath, FirmwareUpdateHandler handler) Update firmware on the printer using the default timeout of 10 minutes.voidupdateFirmwareUnconditionally(String firmwareFilePath, long timeout, FirmwareUpdateHandler handler) Update firmware on the printer, using the specifiedtimeout, regardless of the firmware version currently on the printer.voidupdateFirmwareUnconditionally(String firmwareFilePath, FirmwareUpdateHandler handler) Update firmware on the printer, using the default timeout of 10 minutes, regardless of the firmware version currently on the printer.
-
Method Details
-
updateFirmware
void updateFirmware(String firmwareFilePath, FirmwareUpdateHandler handler) throws ConnectionException, ZebraPrinterLanguageUnknownException, ZebraIllegalArgumentException, DiscoveryException, TimeoutException, FileNotFoundException Update firmware on the printer using the default timeout of 10 minutes. 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.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(); } } }- Parameters:
firmwareFilePath- File path of firmware filehandler- callback for firmware updating status- Throws:
ConnectionException- 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 onlineTimeoutException- if the maximum timeout is reached prior to the printer coming back online with the new firmwareFileNotFoundException- Firmware file not found
-
updateFirmware
void updateFirmware(String firmwareFilePath, long timeout, FirmwareUpdateHandler handler) throws ConnectionException, ZebraPrinterLanguageUnknownException, ZebraIllegalArgumentException, DiscoveryException, TimeoutException, FileNotFoundException Update firmware on the printer using the specifiedtimeout. 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.- Parameters:
firmwareFilePath- File path of firmware filetimeout- Timeout in milliseconds. The minimum allowed timeout is 10 minutes (600000ms) 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 status- Throws:
ConnectionException- 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 onlineTimeoutException- if the maximum timeout is reached prior to the printer coming back online with the new firmwareFileNotFoundException- Firmware file not found
-
updateFirmwareUnconditionally
void updateFirmwareUnconditionally(String firmwareFilePath, FirmwareUpdateHandler handler) throws ConnectionException, ZebraPrinterLanguageUnknownException, ZebraIllegalArgumentException, DiscoveryException, TimeoutException, FileNotFoundException Update firmware on the printer, using the default timeout of 10 minutes, regardless of the firmware version currently on the printer.- Parameters:
firmwareFilePath- File path of firmware filehandler- callback for firmware updating status- Throws:
ConnectionException- 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 onlineTimeoutException- if the maximum timeout is reached prior to the printer coming back online with the new firmwareFileNotFoundException- Firmware file not found
-
updateFirmwareUnconditionally
void updateFirmwareUnconditionally(String firmwareFilePath, long timeout, FirmwareUpdateHandler handler) throws ConnectionException, ZebraPrinterLanguageUnknownException, ZebraIllegalArgumentException, DiscoveryException, TimeoutException, FileNotFoundException Update firmware on the printer, using the specifiedtimeout, regardless of the firmware version currently on the printer.- Parameters:
firmwareFilePath- File path of firmware filetimeout- Timeout in milliseconds. The minimum allowed timeout is 10 minutes (600000ms) 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 status- Throws:
ConnectionException- 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 onlineTimeoutException- if the maximum timeout is reached prior to the printer coming back online with the new firmwareFileNotFoundException- Firmware file not found
-