17#include <zephyr/types.h>
65 int (*
write)(
const void *
const buf,
size_t len);
66 int (*
done)(
bool successful);
int dfu_target_done(bool successful)
Release the resources that were needed for the current DFU target.
int dfu_target_init(int img_type, int img_num, size_t file_size, dfu_target_callback_t cb)
Initialize the resources needed for the specific image type DFU target.
int dfu_target_reset(void)
Release the resources that were needed for the current DFU target if any and resets the current DFU t...
enum dfu_target_image_type dfu_target_smp_img_type_check(const void *const buf, size_t len)
Find the image type for the buffer of bytes received. Used to validate type for DFU SMP target to ini...
dfu_target_evt_id
Definition: dfu_target.h:52
@ DFU_TARGET_EVT_ERASE_PENDING
Definition: dfu_target.h:53
@ DFU_TARGET_EVT_ERASE_DONE
Definition: dfu_target.h:55
@ DFU_TARGET_EVT_TIMEOUT
Definition: dfu_target.h:54
int dfu_target_write(const void *const buf, size_t len)
Write the given buffer to the initialized DFU target.
void(* dfu_target_callback_t)(enum dfu_target_evt_id evt_id)
Definition: dfu_target.h:58
int dfu_target_schedule_update(int img_num)
Schedule update of one or more images.
enum dfu_target_image_type dfu_target_img_type(const void *const buf, size_t len)
Find the image type for the buffer of bytes received. Used to determine what DFU target to initialize...
int dfu_target_offset_get(size_t *offset)
Get offset of the firmware upgrade.
dfu_target_image_type
DFU image type.
Definition: dfu_target.h:28
@ DFU_TARGET_IMAGE_TYPE_NONE
Definition: dfu_target.h:30
@ DFU_TARGET_IMAGE_TYPE_ANY_APPLICATION
Definition: dfu_target.h:42
@ DFU_TARGET_IMAGE_TYPE_ANY
Definition: dfu_target.h:47
@ DFU_TARGET_IMAGE_TYPE_ANY_MODEM
Definition: dfu_target.h:44
@ DFU_TARGET_IMAGE_TYPE_FULL_MODEM
Definition: dfu_target.h:36
@ DFU_TARGET_IMAGE_TYPE_SMP
Definition: dfu_target.h:38
@ DFU_TARGET_IMAGE_TYPE_MCUBOOT
Definition: dfu_target.h:32
@ DFU_TARGET_IMAGE_TYPE_MODEM_DELTA
Definition: dfu_target.h:34
@ DFU_TARGET_IMAGE_TYPE_SUIT
Definition: dfu_target.h:40
int(* init)(size_t file_size, int img_num, dfu_target_callback_t cb)
Definition: dfu_target.h:63
int(* done)(bool successful)
Definition: dfu_target.h:66
int(* write)(const void *const buf, size_t len)
Definition: dfu_target.h:65
int(* offset_get)(size_t *offset)
Definition: dfu_target.h:64
int(* reset)()
Definition: dfu_target.h:68
int(* schedule_update)(int img_num)
Definition: dfu_target.h:67
Functions which needs to be supported by all DFU targets.
Definition: dfu_target.h:62