Package com.avsystem.anjay
Class AnjayFirmwareUpdate
- java.lang.Object
-
- com.avsystem.anjay.AnjayFirmwareUpdate
-
public final class AnjayFirmwareUpdate extends java.lang.ObjectDefault implementation of Firmware Update object (/5).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAnjayFirmwareUpdate.InitialStateInformation about the state to initialize the Firmware Update object in.static classAnjayFirmwareUpdate.ResultValues of the Firmware Update Result resource.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AnjayFirmwareUpdateinstall(Anjay anjay, AnjayFirmwareUpdateHandlers handlers, AnjayFirmwareUpdate.InitialState initialState)Installs the Firmware Update object in an Anjay object.voidsetResult(AnjayFirmwareUpdate.Result result)Sets the Firmware Update Result, interrupting the update process.
-
-
-
Method Detail
-
install
public static AnjayFirmwareUpdate install(Anjay anjay, AnjayFirmwareUpdateHandlers handlers, AnjayFirmwareUpdate.InitialState initialState) throws java.lang.Exception
Installs the Firmware Update object in an Anjay object.- Parameters:
anjay- Anjay object for which the Firmware Update Object is installed.handlers- Implemented handlers used during firmware update process.initialState- Information about the state to initialize the Firmware Update object in. It is intended to be used after either an orderly reboot caused by a firmware update attempt to report the update result, or by an unexpected reboot in the middle of the download process.- Returns:
AnjayFirmwareUpdateobject which can be used to set result of the firmware update process.- Throws:
java.lang.Exception- In case of error.
-
setResult
public void setResult(AnjayFirmwareUpdate.Result result) throws java.lang.Exception
Sets the Firmware Update Result, interrupting the update process.A successful call to this function always sets Update State to Idle (0). If the function fails, neither Update State nor Update Result are changed.
Some state transitions are disallowed and cause this function to fail:
INITIALis never allowed and causes this function to fail.SUCCESSis only allowed if the firmware application process was started by the server (an Execute operation was already performed on the Update resource of the Firmware Update object orUPDATINGwas used in a call toinstall(). Otherwise, the function fails.- Other values of
result(various error codes) are only allowed if Firmware Update State is not Idle (0), i.e. firmware is being downloaded, was already downloaded or is being applied.
WARNING: calling this in
AnjayFirmwareUpdateHandlers.performUpgrade()handler is supported, but the result of using it from within any other ofAnjayFirmwareUpdateHandlersis undefined.- Parameters:
result- Value of the Update Result resource to set.- Throws:
java.lang.Exception- If the result can't be set.
-
-