Interface FirmwareUpdateCallback

All Known Implementing Classes:
FirmwareUpdatableLink

public interface FirmwareUpdateCallback
Callback interface for firmware update events. Every update process must have a FirmwareUpdateCallback to react to key states of the update process. When using FirmwareUpdateLink, this will be provided internally by the link, but can be overridden as needed. In cases where devices don't have a one to one relationship with links, such as shared bus like CAN, this can be used to coordinate updates at a lower level than links allow.
Version:
2023-10-05
  • Method Details

    • onNoUpdateRequired

      void onNoUpdateRequired(FirmwareService service, FirmwareUpdatableDevice device)
      No update required.
      Parameters:
      service - the firmware service
      device - the device that is ready for use
    • onUpdateRequired

      default boolean onUpdateRequired(FirmwareService service, UpdateTask task)
      Update required using the specified task. If this returns true, the task will be queued so that the update can take place. Returning false indicates that the task should not be automatically queued. The task can be manually queued later using service.queueUpdate(task) which allows for fine grained control over updates, including requiring user confirmation for an update. The default implementation returns true. Override as needed.
      Parameters:
      service - the firmware service
      task - the update task
      Returns:
      true if the task will become part of a job, false if aborted
    • onUpdateSuccess

      void onUpdateSuccess(FirmwareService service, UpdateTask task)
      Update was successfully performed.
      Parameters:
      service - the firmware service
      task - the task that just completed
    • onUpdateFailed

      boolean onUpdateFailed(FirmwareService service, UpdateTask task, boolean permanent)
      Update failed. If the permanent flag isn't set, returning true will retry the update automatically. Once permanent is set, no more retries will be attempted.
      Parameters:
      service - the firmware service
      task - the task that just failed
      permanent - if true, no more update attempts will be performed
      Returns:
      true to retry, false to abort