nRF Connect SDK API 2.8.0
Loading...
Searching...
No Matches
dfu_target_full_modem.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
14#ifndef DFU_TARGET_FULL_MODEM_H__
15#define DFU_TARGET_FULL_MODEM_H__
16
17#include <stddef.h>
18#include <sys/types.h>
19#include <zephyr/device.h>
20#include <dfu/dfu_target.h>
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
27 /* Flash device to use for storing the modem firmware. */
28 const struct device *dev;
29
30 /* Offset within the device to store the modem firmware. */
31 off_t offset;
32
33 /* Number of bytes to set aside in the device for storing the modem
34 * firmware. Set this to '0' to use all available flash (starting from
35 * `offset`.
36 */
37 size_t size;
38};
39
41 /* Buffer for writes to `fmfu_dev`. */
42 uint8_t *buf;
43
44 /* Length of `buf` */
45 size_t len;
46
47 /* Flash device for storing the modem firmware.
48 * Ignored if CONFIG_DFU_TARGET_FULL_MODEM_USE_EXT_PARTITION is enabled.
49 */
51};
52
61
70
78bool dfu_target_full_modem_identify(const void *const buf);
79
90int dfu_target_full_modem_init(size_t file_size, int img_num,
91 dfu_target_callback_t callback);
92
101
110int dfu_target_full_modem_write(const void *const buf, size_t len);
111
120int dfu_target_full_modem_done(bool successful);
121
132
141
142#endif /* DFU_TARGET_FULL_MODEM_H__ */
143
int dfu_target_full_modem_schedule_update(int img_num)
Schedule update of the image.
int dfu_target_full_modem_fdev_get(struct dfu_target_fmfu_fdev *const fdev)
Get the configured flash device information.
int dfu_target_full_modem_reset(void)
Release resources and erase the download area.
bool dfu_target_full_modem_identify(const void *const buf)
See if data in buf indicates a full modem update.
int dfu_target_full_modem_cfg(const struct dfu_target_full_modem_params *params)
Configure resources required by dfu_target_full_modem.
int dfu_target_full_modem_init(size_t file_size, int img_num, dfu_target_callback_t callback)
Initialize dfu target, perform steps necessary to receive firmware.
int dfu_target_full_modem_offset_get(size_t *offset)
Get offset of firmware.
int dfu_target_full_modem_done(bool successful)
Release resources and finalize firmware upgrade if successful.
int dfu_target_full_modem_write(const void *const buf, size_t len)
Write firmware data.
void(* dfu_target_callback_t)(enum dfu_target_evt_id evt_id)
Definition dfu_target.h:58
size_t size
Definition dfu_target_full_modem.h:37
const struct device * dev
Definition dfu_target_full_modem.h:28
off_t offset
Definition dfu_target_full_modem.h:31
Definition dfu_target_full_modem.h:26
uint8_t * buf
Definition dfu_target_full_modem.h:42
struct dfu_target_fmfu_fdev * dev
Definition dfu_target_full_modem.h:50
size_t len
Definition dfu_target_full_modem.h:45
Definition dfu_target_full_modem.h:40