Class FirmwareService
- Since:
- 1
- Version:
- 1
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringSection prefix that this service will automatically scan for firmware kabs -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFirmware(KabFile kab) Add a firmware kab file.voidcancelUpdate(FirmwareUpdatableDevice device) Called if a device is no longer valid.getAvailableFirmware(String boardType, String firmwareType) Return the list of available firmware with the specified board and firmware types;getAvailableFirmware(String boardType, String firmwareType, String boardRevision) Return the list of available firmware with the specified board and firmware types and an optional board revision.getNewestFirmware(String boardType, String firmwareType, String ignoreVersion) Return the newest available firmware for the specified boardType and firmwareType.getNewestFirmware(String boardType, String firmwareType, String boardRevision, String ignoreVersion) Return the newest available firmware for the specified boardType and firmwareType.getNewestFirmware(String boardType, String firmwareType, String boardRevision, String ignoreVersion, Comparator<FirmwareInfo> versionComparator) Return the newest available firmware for the specified boardType and firmwareType.voidqueueUpdate(UpdateTask task) Queue anUpdateTaskto be run.voidremoveFirmware(KabFile kab) Remove a firmware kab from the list of available firmware.voidupdateFirmware(FirmwareUpdatableDevice device, FirmwareUpdater updater, FirmwareUpdateCallback callback) Queue the device for firmware update if needed.
-
Field Details
-
SECTION_PREFIX_FIRMWARE
Section prefix that this service will automatically scan for firmware kabs- See Also:
-
-
Method Details
-
getAvailableFirmware
Return the list of available firmware with the specified board and firmware types;- Parameters:
boardType- the type of the board to matchfirmwareType- the type of firmware to match- Since:
- 1
-
getAvailableFirmware
public List<FirmwareInfo> getAvailableFirmware(String boardType, String firmwareType, String boardRevision) Return the list of available firmware with the specified board and firmware types and an optional board revision. Board revisions allow different versions of a given board to have different firmware.- Parameters:
boardType- the type of the board to matchfirmwareType- the type of firmware to matchboardRevision- optional revision to match- Since:
- 1
-
getNewestFirmware
Return the newest available firmware for the specified boardType and firmwareType.If the optional ignoreVersion is specified and it matches the newest version, null will be returned instead of the newest firmware. This allows the currently installed firmware version to be specified so that null is returned if already installed.
This uses the default version comparator which supports four digit version numbers. To use custom version sorting, use the method with optional comparator.
- Parameters:
boardType- the type of the board to matchfirmwareType- the type of firmware to matchignoreVersion- optional version to ignore- Since:
- 1
-
getNewestFirmware
public FirmwareInfo getNewestFirmware(String boardType, String firmwareType, String boardRevision, String ignoreVersion) Return the newest available firmware for the specified boardType and firmwareType. If the optional boardRevision is specified, only firmware compatible with the specified revision will be considered.If the optional ignoreVersion is specified and it matches the newest version, null will be returned instead of the newest firmware. This allows the currently installed firmware version to be specified so that null is returned if already installed.
This uses the default version comparator which supports four digit version numbers. To use custom version sorting, use the method with optional comparator.
- Parameters:
boardType- the type of the board to matchfirmwareType- the type of firmware to matchboardRevision- optional revision to matchignoreVersion- optional version to ignore- Since:
- 1
-
getNewestFirmware
public FirmwareInfo getNewestFirmware(String boardType, String firmwareType, String boardRevision, String ignoreVersion, Comparator<FirmwareInfo> versionComparator) Return the newest available firmware for the specified boardType and firmwareType. If the optional boardRevision is specified, only firmware compatible with the specified revision will be considered.If the optional ignoreVersion is specified and it matches the newest version, null will be returned instead of the newest firmware. This allows the currently installed firmware version to be specified so that null is returned if already installed.
This uses the specified comparator to compare version numbers. This allows custom versions to be used. When sorted with the comparator, the first available firmware in the resulting list is returned. If not specified, the default comparator will be used which supports four digit versions.
- Parameters:
boardType- the type of the board to matchfirmwareType- the type of firmware to matchboardRevision- optional revision to matchignoreVersion- optional version to ignoreversionComparator- custom comparator for version numbers- Since:
- 1
-
addFirmware
Add a firmware kab file. This will process the firmware section from the kab descriptor and make the results searchable.- Parameters:
kab- the kab that contains firmware- Since:
- 1
-
removeFirmware
Remove a firmware kab from the list of available firmware.- Parameters:
kab- the firmware kab to remove- Since:
- 9
-
updateFirmware
public void updateFirmware(FirmwareUpdatableDevice device, FirmwareUpdater updater, FirmwareUpdateCallback callback) Queue the device for firmware update if needed. Devices will sit in this queue until firmware mgr finishes scanning all available firmware and then each device will be checked one at a time. If the firmware on a given device needs to be updated, that device will be put into the upgrade queue.- Parameters:
device- device to updateupdater- performs the actual updatecallback- callback to notify when device is ready- Since:
- 1
-
cancelUpdate
Called if a device is no longer valid. This will remove it from the update process, allowing a new instance of the device to queue a new job. If an update is in progress, it will be cancelled. It's the responsibility of the updater to leave the hardware in a valid state when cancelled.- Since:
- 1
-
queueUpdate
Queue anUpdateTaskto be run. This should only be called with anUpdateTaskprovided toonUpdateRequired()where this method returned false. This provides a way for user code to start the otherwise blocked update. The most common reason for this flow is in the event that a user must confirm an update. This allowsonUpdateRequired()to return false, user code can then hold the task and callqueueUpdate()once the user confirms the update.- Since:
- 1
-
getHardwareService
-