Class AnjayFirmwareUpdate.InitialState
- java.lang.Object
-
- com.avsystem.anjay.AnjayFirmwareUpdate.InitialState
-
- Enclosing class:
- AnjayFirmwareUpdate
public static final class AnjayFirmwareUpdate.InitialState extends java.lang.ObjectInformation about the state to initialize the Firmware Update object in.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAnjayFirmwareUpdate.InitialState.InitialResultPossible values that control the State and Update Result resources at the time of initialization of the Firmware Update object.
-
Field Summary
Fields Modifier and Type Field Description java.lang.StringpersistedUriValue to initialize the Package URI resource with.AnjayFirmwareUpdate.InitialState.InitialResultresultControls initialization of the State and Update Result resources.java.util.Optional<byte[]>resumeEtagETag of the download process to resume.intresumeOffsetNumber of bytes that has been already successfully downloaded and are available at the time of callinginstall.
-
Constructor Summary
Constructors Constructor Description InitialState()
-
-
-
Field Detail
-
result
public AnjayFirmwareUpdate.InitialState.InitialResult result
Controls initialization of the State and Update Result resources. It is intended to be used after a reboot caused by a firmware update attempt, to report the update result.
-
persistedUri
public java.lang.String persistedUri
Value to initialize the Package URI resource with.Required when
resultis set toDOWNLOADING; if it is not provided in such case,AnjayFirmwareUpdateHandlers.reset()handler will be called frominstallto reset the Firmware Update object into the Idle state.Optional when
resultisDOWNLOADED; in this case it signals that the firmware was downloaded using the Pull mechanism.In all other cases it is ignored.
-
resumeOffset
public int resumeOffset
Number of bytes that has been already successfully downloaded and are available at the time of callinginstall.It is ignored unless
resultisDOWNLOADING, in which case the following call toAnjayFirmwareUpdateHandlers.streamWrite(byte[])shall append the passed chunk of data at the offset set here. If resumption from the set offset is impossible, the library will callAnjayFirmwareUpdateHandlers.reset()andAnjayFirmwareUpdateHandlers.streamOpen(java.util.Optional<java.lang.String>, java.util.Optional<byte[]>)to restart the download process.
-
resumeEtag
public java.util.Optional<byte[]> resumeEtag
ETag of the download process to resume.Required when
resultisDOWNLOADINGandresumeOffset> 0; if it is not provided in such case,AnjayFirmwareUpdateHandlers.reset()handler will be called frominstallto reset the Firmware Update object into the Idle state.
-
-