TargetImage

constructor(data: @NotNull Array<Byte>)

This constructor creates a basic image target. It will be sent to the secondary slot (slot = 1) of the default core (image index = 0).

This constructor can be used to send an update to a single core device that does not support Direct XIP (option to boot an image from a non-primary image).

Parameters

data

the signed binary to be sent.

Throws

when the image does not have a valid mcu header


constructor(imageIndex: Int, data: @NotNull Array<Byte>)

This constructor creates a basic image targeting specified core (image index). The binary will be sent to the secondary slot (slot = 1) for that core.

This constructor can be used to send an update to a multi-core device that does not support Direct XIP (option to boot an image from a non-primary image).

Parameters

imageIndex

an index of the core (0 is the main (app) core, 1 is secondary (network) core, etc.

data

the signed binary to be sent.

Throws

when the image does not have a valid mcu header


constructor(imageIndex: Int, slot: Int, data: @NotNull Array<Byte>)

This constructor allows to define a target for a multi-core device with support for Direct XIP (option to run an image from a noo-primary slot. In that case it should contain binaries compiled for any slot and the DFU uploader will determine the correct slot when validating the device.

Parameters

imageIndex

an index of the core (0 is the main (app) core, 1 is secondary (network) core, etc.

slot

0 for a primary slot and 1 for a secondary slot.

data

the signed binary to be sent.

Throws

when the image does not have a valid mcu header