FirmwareUpdaterLinkOsUpdateFirmware Method (String, FirmwareUpdateHandler)
|
Update firmware on the printer using the default timeout of 10 minutes.
Namespace:
Zebra.Sdk.Printer
Assembly:
SdkApi_Core (in SdkApi_Core.dll) Version: 2.14.1869
Syntax void UpdateFirmware(
string firmwareFilePath,
FirmwareUpdateHandler handler
)
Sub UpdateFirmware (
firmwareFilePath As String,
handler As FirmwareUpdateHandler
)
void UpdateFirmware(
String^ firmwareFilePath,
FirmwareUpdateHandler^ handler
)
Parameters
- firmwareFilePath
- Type: SystemString
File path of firmware file. - handler
- Type: Zebra.Sdk.PrinterFirmwareUpdateHandler
Callback for firmware updating status
Exceptions Remarks
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.
Examples using System;
using Zebra.Sdk.Comm;
using Zebra.Sdk.Printer;
public class UpdatePrinterFirmwareExample {
public static void Main(string[] args) {
string theIpAddress = "1.2.3.4";
string firmwareFilePath = "fullPathToFirmwareFile";
Connection connection = new TcpConnection(theIpAddress, TcpConnection.DEFAULT_ZPL_TCP_PORT);
try {
connection.Open();
ZebraPrinterLinkOs p = ZebraPrinterFactory.GetLinkOsPrinter(connection);
p.UpdateFirmware(firmwareFilePath, new UpdateFirmareHandler());
} catch (Exception e) {
Console.WriteLine(e.ToString());
} finally {
connection.Close();
}
}
private class UpdateFirmareHandler : FirmwareUpdateHandler {
public override void FirmwareDownloadComplete() {
Console.WriteLine("Firmware download complete.");
}
public override void PrinterOnline(ZebraPrinterLinkOs printer, string firmwareVersion) {
Console.WriteLine($"Printer online with firmware version={firmwareVersion}");
}
public override void ProgressUpdate(int bytesWritten, int totalBytes) {
}
}
}
See Also