McuMgrImage

Represents a firmware image for devices using McuBoot or the legacy Apache Mynewt bootloader. On initialization, the image data will be validated. A firmware image of this format contains an image header and type-length-value trailer for image meta-data.

For more info about McuBoot and image format see: https://juullabs-oss.github.io/mcuboot/design.html

Constructors

Link copied to clipboard
constructor(@NotNull header: @NotNull McuMgrImageHeader, @Nullable protectedTlv: @Nullable McuMgrImageTlv, @NotNull tlv: @NotNull McuMgrImageTlv, hash: @NotNull Array<Byte>, data: @NotNull Array<Byte>)
constructor(data: @NotNull Array<Byte>)

Properties

Link copied to clipboard
val IMG_HASH_LEN: Int = 32

Functions

Link copied to clipboard
@NotNull
open fun fromBytes(data: @NotNull Array<Byte>): @NotNull McuMgrImage
Link copied to clipboard
open fun getData(): @NotNull Array<Byte>
Returns the image data.
Link copied to clipboard
open fun getHash(): @NotNull Array<Byte>
Returns the hash of the image.
open fun getHash(data: @NotNull Array<Byte>): @NotNull Array<Byte>
Link copied to clipboard
@NotNull
open fun getHeader(): @NotNull McuMgrImageHeader
Link copied to clipboard
@Nullable
open fun getProtectedTlv(): @Nullable McuMgrImageTlv
Link copied to clipboard
@NotNull
open fun getTlv(): @NotNull McuMgrImageTlv
Link copied to clipboard
Returns true if the image needs confirmation to be applied.