nRF Connect SDK API 2.8.99
Loading...
Searching...
No Matches
dfu_multi_image.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef DFU_MULTI_IMAGE_H__
8#define DFU_MULTI_IMAGE_H__
9
43#include <stdbool.h>
44#include <stddef.h>
45#include <stdint.h>
46
47#ifdef __cplusplus
48extern "C" {
49#endif
50
51typedef int (*dfu_image_open_t)(int image_id, size_t image_size);
52typedef int (*dfu_image_write_t)(const uint8_t *chunk, size_t chunk_size);
53typedef int (*dfu_image_close_t)(bool success);
54
97
114int dfu_multi_image_init(uint8_t *buffer, size_t buffer_size);
115
129
156int dfu_multi_image_write(size_t offset, const uint8_t *chunk, size_t chunk_size);
157
164
179int dfu_multi_image_done(bool success);
180
181#ifdef __cplusplus
182}
183#endif
184
187#endif /* DFU_MULTI_IMAGE_H__ */
int dfu_multi_image_done(bool success)
Complete DFU Multi Image package write.
int(* dfu_image_close_t)(bool success)
Definition dfu_multi_image.h:53
int(* dfu_image_write_t)(const uint8_t *chunk, size_t chunk_size)
Definition dfu_multi_image.h:52
int(* dfu_image_open_t)(int image_id, size_t image_size)
Definition dfu_multi_image.h:51
int dfu_multi_image_register_writer(const struct dfu_image_writer *writer)
Register DFU image writer.
int dfu_multi_image_write(size_t offset, const uint8_t *chunk, size_t chunk_size)
Write subsequent DFU Multi Image package chunk.
int dfu_multi_image_init(uint8_t *buffer, size_t buffer_size)
Initialize DFU Multi Image library context.
size_t dfu_multi_image_offset(void)
Returns DFU Multi Image package write position.
dfu_image_close_t close
Function called after writing the last byte of the applicable image.
Definition dfu_multi_image.h:95
dfu_image_write_t write
Function called to write a subsequent chunk of the applicable image.
Definition dfu_multi_image.h:83
int image_id
Identifier of the applicable image.
Definition dfu_multi_image.h:62
dfu_image_open_t open
Function called before writing the first byte of the applicable image.
Definition dfu_multi_image.h:73
User-provided functions for writing a single image from DFU Multi Image package.
Definition dfu_multi_image.h:58