Class FirmwareService
java.lang.Object
com.tccc.kos.commons.util.ready.ReadyBean
com.tccc.kos.commons.core.service.AbstractService
com.tccc.kos.core.service.firmware.FirmwareService
- All Implemented Interfaces:
CtxEventListener
,ContextHandleAware
,HandleAware
,Ready
,ReadyListener
Service that handles updating firmware on update-capable devices.
- Version:
- 2023-10-05
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cancelUpdate
(FirmwareUpdatableDevice device) Called if a device is no longer valid.void
queueUpdate
(UpdateTask task) Queue anUpdateTask
to be run.void
updateFirmware
(FirmwareUpdatableDevice device, FirmwareUpdater updater, FirmwareUpdateCallback callback) Queue the device for firmware update if needed.Methods inherited from class com.tccc.kos.commons.core.service.AbstractService
getHandle, getHandlePrefix
Methods inherited from class com.tccc.kos.commons.util.ready.ReadyBean
getReady, onBeanReady, onDependenciesReady
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.tccc.kos.commons.core.context.CtxEventListener
onCtxAutowiringCompleted, onCtxDestroyed, onCtxPhaseCompleted
Methods inherited from interface com.tccc.kos.commons.core.service.handle.HandleAware
addHandleChild, getName, getPath
Methods inherited from interface com.tccc.kos.commons.util.ready.ReadyListener
onDependenciesGroupReady
-
Method Details
-
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
-
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. -
queueUpdate
Queue anUpdateTask
to be run. This should only be called with anUpdateTask
provided 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. -
getHardwareService
-