Interface FirmwareUpdateService


@NonNullByDefault public interface FirmwareUpdateService
The firmware update service is registered as an OSGi service and is responsible for tracking all available FirmwareUpdateHandlers. It provides access to the current FirmwareStatusInfo of a thing and is the central instance to start a firmware update.
Author:
Thomas Höfer - Initial contribution, Dimitar Ivanov - Extracted interface
  • Method Details

    • getFirmwareStatusInfo

      @Nullable FirmwareStatusInfo getFirmwareStatusInfo(ThingUID thingUID)
      Returns the FirmwareStatusInfo for the thing having the given thing UID.
      Parameters:
      thingUID - the UID of the thing (must not be null)
      Returns:
      the firmware status info (is null if there is no FirmwareUpdateHandler for the thing available)
    • updateFirmware

      void updateFirmware(ThingUID thingUID, String firmwareVersion, @Nullable Locale locale)
      Updates the firmware of the thing having the given thing UID by invoking the operation FirmwareUpdateHandler.updateFirmware(Firmware, ProgressCallback) of the thing´s firmware update handler.

      This operation is a non-blocking operation by spawning a new thread around the invocation of the firmware update handler. The time out of the thread is 30 minutes.

      Parameters:
      thingUID - the thing UID (must not be null)
      firmwareVersion - the version of the firmware to be updated (must not be null)
      locale - the locale to be used to internationalize error messages (if null then the locale provided by the LocaleProvider is used)
      Throws:
      IllegalStateException - if
      • there is no firmware update handler for the thing
      • the firmware update handler is not able to execute the firmware update
      IllegalArgumentException - if
      • the firmware cannot be found
      • the firmware is not suitable for the thing
      • the firmware requires another prerequisite firmware version
    • cancelFirmwareUpdate

      void cancelFirmwareUpdate(ThingUID thingUID)
      Cancels the firmware update of the thing having the given thing UID by invoking the operation FirmwareUpdateHandler.cancel() of the thing´s firmware update handler.
      Parameters:
      thingUID - the thing UID (must not be null)