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 Summary
Modifier and TypeMethodDescriptionvoid
onNoUpdateRequired
(FirmwareService service, FirmwareUpdatableDevice device) No update required.boolean
onUpdateFailed
(FirmwareService service, UpdateTask task, boolean permanent) Update failed.default boolean
onUpdateRequired
(FirmwareService service, UpdateTask task) Update required using the specified task.void
onUpdateSuccess
(FirmwareService service, UpdateTask task) Update was successfully performed.
-
Method Details
-
onNoUpdateRequired
No update required.- Parameters:
service
- the firmware servicedevice
- the device that is ready for use
-
onUpdateRequired
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 usingservice.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 servicetask
- the update task- Returns:
- true if the task will become part of a job, false if aborted
-
onUpdateSuccess
Update was successfully performed.- Parameters:
service
- the firmware servicetask
- the task that just completed
-
onUpdateFailed
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 servicetask
- the task that just failedpermanent
- if true, no more update attempts will be performed- Returns:
- true to retry, false to abort
-