Interface FirmwareUpdaterLinkOs

All Known Subinterfaces:
ZebraPrinterLinkOs

public interface FirmwareUpdaterLinkOs
This is the interface for updating firmware on a Link-OS™ printer.
  • Method Details

    • updateFirmware

      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 file
      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 determined
      ZebraIllegalArgumentException - if an invalid firmware file is specified for the printer
      DiscoveryException - if an error occurs while waiting for the printer to come back online
      TimeoutException - if the maximum timeout is reached prior to the printer coming back online with the new firmware
      FileNotFoundException - Firmware file not found
    • updateFirmware

      Update firmware on the printer using the specified 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.
      Parameters:
      firmwareFilePath - File path of firmware file
      timeout - 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 determined
      ZebraIllegalArgumentException - if an invalid firmware file is specified for the printer
      DiscoveryException - if an error occurs while waiting for the printer to come back online
      TimeoutException - if the maximum timeout is reached prior to the printer coming back online with the new firmware
      FileNotFoundException - Firmware file not found
    • updateFirmwareUnconditionally

      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 file
      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 determined
      ZebraIllegalArgumentException - if an invalid firmware file is specified for the printer
      DiscoveryException - if an error occurs while waiting for the printer to come back online
      TimeoutException - if the maximum timeout is reached prior to the printer coming back online with the new firmware
      FileNotFoundException - Firmware file not found
    • updateFirmwareUnconditionally

      Update firmware on the printer, using the specified timeout, regardless of the firmware version currently on the printer.
      Parameters:
      firmwareFilePath - File path of firmware file
      timeout - 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 determined
      ZebraIllegalArgumentException - if an invalid firmware file is specified for the printer
      DiscoveryException - if an error occurs while waiting for the printer to come back online
      TimeoutException - if the maximum timeout is reached prior to the printer coming back online with the new firmware
      FileNotFoundException - Firmware file not found