nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches

◆ dfu_target_init()

int dfu_target_init ( int  img_type,
int  img_num,
size_t  file_size,
dfu_target_callback_t  cb 
)

#include <include/dfu/dfu_target.h>

Initialize the resources needed for the specific image type DFU target.

If a target update is in progress, and the same target is given as input, then calling the 'init()' function of that target is skipped.

To allow continuation of an aborted DFU procedure, call the 'dfu_target_offset_get' function after invoking this function.

Parameters
[in]img_typeImage type identifier.
[in]img_numImage pair index. Value different than 0 are supported only for DFU_TARGET_IMAGE_TYPE_MCUBOOT image type currently.
[in]file_sizeSize of the current file being downloaded.
[in]cbCallback function in case the DFU operation requires additional procedures to be called.
Returns
0 for a supported image type or a negative error code indicating reason of failure.